Fixes for pypowervm wrappers moving to @propertys

Change-Id: Ic8aa225a96a9037ae941ed4370da5cc6e8d4a946
This commit is contained in:
Eric Fried 2015-01-21 15:32:28 -06:00
parent 902c2585e1
commit 05d2f314ec
5 changed files with 14 additions and 14 deletions

View File

@ -95,7 +95,7 @@ class PowerVMDriver(driver.ComputeDriver):
raise Exception("Host %s not found" % CONF.pvm_host_mtms)
self.host_wrapper = msentry_wrapper.ManagedSystem(host_entry)
self.host_uuid = self.host_wrapper.get_uuid()
self.host_uuid = self.host_wrapper.uuid
LOG.info(_LI("Host UUID is:%s") % self.host_uuid)
def _log_operation(self, op, instance):

View File

@ -50,9 +50,9 @@ def parse_mtm(mtm_serial):
def get_mtm_serial(msentry):
mt = msentry.get_type()
md = msentry.get_model()
ms = msentry.get_serial()
mt = msentry.machine_type
md = msentry.model
ms = msentry.serial
return mt + md + '_' + ms
@ -67,7 +67,7 @@ def find_entry_by_mtm_serial(resp, mtm_serial):
# Confirm same model and type
for entry in entries:
wrapper = msentry_wrapper.ManagedSystem(entry)
if (wrapper.get_type() == mt and wrapper.get_model() == md):
if (wrapper.machine_type == mt and wrapper.model == md):
return entry
# No matching MTM Serial was found
@ -85,15 +85,15 @@ def build_host_resource_from_entry(msentry):
data = {}
# Calculate the vcpus
proc_units = msentry.get_proc_units_configurable()
proc_units_avail = msentry.get_proc_units_avail()
proc_units = msentry.proc_units_configurable
proc_units_avail = msentry.proc_units_avail
pu_used = float(proc_units) - float(proc_units_avail)
data['vcpus'] = int(math.ceil(float(proc_units)))
data['vcpus_used'] = int(math.ceil(pu_used))
data['memory_mb'] = msentry.get_memory_configurable()
data['memory_mb_used'] = (msentry.get_memory_configurable() -
msentry.get_memory_free())
data['memory_mb'] = msentry.memory_configurable
data['memory_mb_used'] = (msentry.memory_configurable -
msentry.memory_free)
# TODO(IBM): make the local gb large for now
data["local_gb"] = (1 << 21)

View File

@ -135,7 +135,7 @@ class LocalStorage(blockdev.StorageAdapter):
# Search the feed for the volume group
for entry in resp.feed.entries:
wrapper = vol_grp.VolumeGroup(entry)
wrap_vg_name = wrapper.get_name()
wrap_vg_name = wrapper.name
LOG.info(_LI('Volume group: %s') % wrap_vg_name)
if name == wrap_vg_name:
uuid = entry.properties['id']

View File

@ -57,7 +57,7 @@ def tf_crt_lpar(adapter, host_uuid, instance, flavor):
# Wrap to the actual delete.
lpar = pvm_lpar.LogicalPartition(result.entry)
vm.dlt_lpar(adapter, lpar.get_uuid())
vm.dlt_lpar(adapter, lpar.uuid)
LOG.info(_LI('Instance %s removed from system') % instance.name)
return task.FunctorTask(
@ -119,7 +119,7 @@ def tf_connect_vol(block_dvr, context, instance):
LOG.info(_LI('Connecting boot disk to instance: %s') % instance.name)
lpar = pvm_lpar.LogicalPartition(lpar_crt_resp.entry)
block_dvr.connect_volume(context, instance, vol_dev_info,
lpar.get_uuid())
lpar.uuid)
return task.FunctorTask(
_task, name='connect_vol',

View File

@ -172,7 +172,7 @@ def get_lpar_list(adapter, host_uuid):
feed = get_lpar_feed(adapter, host_uuid)
if feed is not None:
for entry in feed.entries:
name = pvm_lpar.LogicalPartition(entry).get_name()
name = pvm_lpar.LogicalPartition(entry).name
lpar_list.append(name)
return lpar_list