Fix 428e9dad.

copied dict was completely replacing current dict, so _partition_id and _computer_id were deleted.
parent 3b7705a5
...@@ -97,7 +97,10 @@ class SlapRequester(SlapDocument): ...@@ -97,7 +97,10 @@ class SlapRequester(SlapDocument):
connection_helper=self._connection_helper, connection_helper=self._connection_helper,
) )
# Hack to give all object attributes to the ComputerPartition instance # Hack to give all object attributes to the ComputerPartition instance
computer_partition.__dict__ = software_instance.__dict__.copy() # XXX Should be removed by correctly specifying difference between
# ComputerPartition and SoftwareInstance
computer_partition.__dict__ = dict(computer_partition.__dict__.items() +
software_instance.__dict__.items())
# XXX not generic enough. # XXX not generic enough.
if xml_marshaller.loads(request_dict['shared_xml']): if xml_marshaller.loads(request_dict['shared_xml']):
computer_partition._synced = True computer_partition._synced = True
...@@ -332,7 +335,7 @@ class Computer(SlapDocument): ...@@ -332,7 +335,7 @@ class Computer(SlapDocument):
return xml_marshaller.loads(xml) return xml_marshaller.loads(xml)
class ComputerPartition(SlapDocument): class ComputerPartition(SlapRequester):
zope.interface.implements(interface.IComputerPartition) zope.interface.implements(interface.IComputerPartition)
...@@ -441,7 +444,7 @@ class ComputerPartition(SlapDocument): ...@@ -441,7 +444,7 @@ class ComputerPartition(SlapDocument):
self._connection_helper.POST('/softwareInstanceRename', post_dict) self._connection_helper.POST('/softwareInstanceRename', post_dict)
def getId(self): def getId(self):
if not self._partition_id: if not getattr(self, '_partition_id', None):
raise ResourceNotReady() raise ResourceNotReady()
return self._partition_id return self._partition_id
......
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