~jk0/nova/improve-pylint-scores

« back to all changes in this revision

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

  • Committer: Tarmac
  • Author(s): Josh Kearney
  • Date: 2011-04-19 19:31:17 UTC
  • mfrom: (996.1.3 improve-pylint-scores)
  • Revision ID: tarmac-20110419193117-k9g6fzoat0f8n0sl
Round 1 of pylint cleanup.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
import uuid
29
29
from xml.dom import minidom
30
30
 
31
 
from eventlet import event
32
31
import glance.client
33
 
from nova import context
34
 
from nova import db
35
32
from nova import exception
36
33
from nova import flags
37
34
from nova import log as logging
306
303
                % locals())
307
304
 
308
305
        vm_vdi_ref, vm_vdi_rec = cls.get_vdi_for_vm_safely(session, vm_ref)
309
 
        vm_vdi_uuid = vm_vdi_rec["uuid"]
310
306
        sr_ref = vm_vdi_rec["SR"]
311
307
 
312
308
        original_parent_uuid = get_vhd_parent_uuid(session, vm_vdi_ref)
755
751
        session.call_xenapi('SR.scan', sr_ref)
756
752
 
757
753
 
758
 
def get_rrd(host, uuid):
 
754
def get_rrd(host, vm_uuid):
759
755
    """Return the VM RRD XML as a string"""
760
756
    try:
761
757
        xml = urllib.urlopen("http://%s:%s@%s/vm_rrd?uuid=%s" % (
762
758
            FLAGS.xenapi_connection_username,
763
759
            FLAGS.xenapi_connection_password,
764
760
            host,
765
 
            uuid))
 
761
            vm_uuid))
766
762
        return xml.read()
767
763
    except IOError:
768
764
        return None
1020
1016
 
1021
1017
def _write_partition(virtual_size, dev):
1022
1018
    dest = '/dev/%s' % dev
1023
 
    mbr_last = MBR_SIZE_SECTORS - 1
1024
1019
    primary_first = MBR_SIZE_SECTORS
1025
1020
    primary_last = MBR_SIZE_SECTORS + (virtual_size / SECTOR_SIZE) - 1
1026
1021