Commit 854a2bf6 authored by Cédric de Saint Martin's avatar Cédric de Saint Martin Committed by Marco Mariani

Fix 428e9dad.

copied dict was completely replacing current dict, so _partition_id and _computer_id were deleted.
parent 385ea052
...@@ -102,7 +102,10 @@ class SlapRequester(SlapDocument): ...@@ -102,7 +102,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
...@@ -336,7 +339,7 @@ class Computer(SlapDocument): ...@@ -336,7 +339,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)
...@@ -444,7 +447,7 @@ class ComputerPartition(SlapDocument): ...@@ -444,7 +447,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