~ubuntu-branches/ubuntu/quantal/nova/quantal-proposed

« back to all changes in this revision

Viewing changes to nova/virt/xenapi/vm_utils.py

  • Committer: Package Import Robot
  • Author(s): Adam Gandelman, Adam Gandelman, Chuck Short
  • Date: 2012-08-27 15:37:18 UTC
  • mfrom: (1.1.60)
  • Revision ID: package-import@ubuntu.com-20120827153718-lj8er44eqqz1gsrj
Tags: 2012.2~rc1~20120827.15815-0ubuntu1
[ Adam Gandelman ]
* New upstream release.

[ Chuck Short ]
* debian/patches/0001-Update-tools-hacking-for-pep8-1.2-and-
  beyond.patch: Dropped we dont run pep8 tests anymore.
* debian/control: Drop pep8 build depends
* debian/*.upstart.in: Make sure we transition correctly from runlevel
  1 to 2. (LP: #820694)

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 
3
3
# Copyright (c) 2010 Citrix Systems, Inc.
4
4
# Copyright 2011 Piston Cloud Computing, Inc.
5
 
# Copyright 2012 Openstack, LLC.
 
5
# Copyright 2012 OpenStack, LLC.
6
6
#
7
7
#    Licensed under the Apache License, Version 2.0 (the "License"); you may
8
8
#    not use this file except in compliance with the License. You may obtain
1246
1246
            yield vm_ref, vm_rec
1247
1247
 
1248
1248
 
1249
 
def lookup_vm_vdis(session, vm_ref, nodestroys=None):
 
1249
def lookup_vm_vdis(session, vm_ref):
1250
1250
    """Look for the VDIs that are attached to the VM"""
1251
1251
    # Firstly we get the VBDs, then the VDIs.
1252
1252
    # TODO(Armando): do we leave the read-only devices?
1259
1259
                # Test valid VDI
1260
1260
                record = session.call_xenapi("VDI.get_record", vdi_ref)
1261
1261
                LOG.debug(_('VDI %s is still available'), record['uuid'])
1262
 
            except session.XenAPI.Failure, exc:
1263
 
                LOG.exception(exc)
1264
 
            else:
1265
 
                if not nodestroys or record['uuid'] not in nodestroys:
 
1262
                vbd_other_config = session.call_xenapi("VBD.get_other_config",
 
1263
                                                       vbd_ref)
 
1264
                if not vbd_other_config.get('osvol'):
 
1265
                    # This is not an attached volume
1266
1266
                    vdi_refs.append(vdi_ref)
 
1267
            except session.XenAPI.Failure, exc:
 
1268
                LOG.exception(exc)
1267
1269
    return vdi_refs
1268
1270
 
1269
1271