Add ComputerPartition._instance_guid getter.

parent 46e1324c
...@@ -248,6 +248,7 @@ def _syncComputerInformation(func): ...@@ -248,6 +248,7 @@ def _syncComputerInformation(func):
if getattr(self, '_synced', 0): if getattr(self, '_synced', 0):
return func(self, *args, **kw) return func(self, *args, **kw)
computer = self._connection_helper.getFullComputerInformation(self._computer_id) computer = self._connection_helper.getFullComputerInformation(self._computer_id)
import pdb; pdb.set_trace()
for key, value in computer.__dict__.items(): for key, value in computer.__dict__.items():
if isinstance(value, unicode): if isinstance(value, unicode):
# convert unicode to utf-8 # convert unicode to utf-8
...@@ -507,6 +508,13 @@ class ComputerPartition(SlapDocument): ...@@ -507,6 +508,13 @@ class ComputerPartition(SlapDocument):
raise ResourceNotReady() raise ResourceNotReady()
return self._partition_id return self._partition_id
@_syncComputerPartitionInformation
def getInstanceGuid(self):
"""Sync if not synced, then returns instance_guid"""
if not getattr(self, '_instance_guid', None):
raise ResourceNotReady()
return self._instance_guid
@_syncComputerPartitionInformation @_syncComputerPartitionInformation
def getState(self): def getState(self):
return self._requested_state return self._requested_state
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment