Commit eae9e1e5 authored by Yingjie Xu's avatar Yingjie Xu

Use full computer information, ready to use promise based client setting.

parent 23b53d55
...@@ -207,7 +207,7 @@ def _syncComputerInformation(func): ...@@ -207,7 +207,7 @@ def _syncComputerInformation(func):
Synchronize computer object with server information Synchronize computer object with server information
""" """
def decorated(self, *args, **kw): def decorated(self, *args, **kw):
computer = self._connection_helper.getComputerInformation(self._computer_id) computer = self._connection_helper.getFullComputerInformation(self._computer_id)
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
...@@ -268,7 +268,7 @@ def _syncComputerPartitionInformation(func): ...@@ -268,7 +268,7 @@ def _syncComputerPartitionInformation(func):
def decorated(self, *args, **kw): def decorated(self, *args, **kw):
if getattr(self, '_synced', 0): if getattr(self, '_synced', 0):
return func(self, *args, **kw) return func(self, *args, **kw)
computer = self._connection_helper.getComputerInformation(self._computer_id) computer = self._connection_helper.getFullComputerInformation(self._computer_id)
found_computer_partition = None found_computer_partition = None
for computer_partition in computer._computer_partition_list: for computer_partition in computer._computer_partition_list:
if computer_partition.getId() == self.getId(): if computer_partition.getId() == self.getId():
...@@ -517,6 +517,10 @@ class ConnectionHelper: ...@@ -517,6 +517,10 @@ class ConnectionHelper:
self.GET('/getComputerInformation?computer_id=%s' % computer_id) self.GET('/getComputerInformation?computer_id=%s' % computer_id)
return xml_marshaller.loads(self.response.read()) return xml_marshaller.loads(self.response.read())
def getFullComputerInformation(self, computer_id):
self.GET('/getFullComputerInformation?computer_id=%s' % computer_id)
return xml_marshaller.loads(self.response.read())
def connect(self): def connect(self):
connection_dict = dict( connection_dict = dict(
host=self.host) host=self.host)
......
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