From be0b435d307173598c30fcacc421b17112137099 Mon Sep 17 00:00:00 2001 From: Marcel Enguehard Date: Tue, 23 May 2017 10:50:17 +0200 Subject: Introduced groups + lxd profiles + diverted control network handling to lxd + misc bug fixes Change-Id: Iae26bc2994ac9704dde7dfa8fbe4be1b74cf9e6f Signed-off-by: Marcel Enguehard --- vicn/core/attribute.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'vicn/core/attribute.py') diff --git a/vicn/core/attribute.py b/vicn/core/attribute.py index f6ec7c70..22f44487 100644 --- a/vicn/core/attribute.py +++ b/vicn/core/attribute.py @@ -42,7 +42,6 @@ class Multiplicity: OneToMany = '1_N' ManyToOne = 'N_1' ManyToMany = 'N_N' - @staticmethod def reverse(value): @@ -108,7 +107,7 @@ class Attribute(abc.ABC, ObjectSpecification): self.is_aggregate = False self._reverse_attributes = list() - + #-------------------------------------------------------------------------- # Display #-------------------------------------------------------------------------- @@ -157,7 +156,7 @@ class Attribute(abc.ABC, ObjectSpecification): value = value.get_uuid() return value else: - try: + try: cur_value = vars(instance)[self.name] if self.is_collection: # copy the list @@ -167,11 +166,11 @@ class Attribute(abc.ABC, ObjectSpecification): if self.is_collection: cur_value = list() - instance._state.dirty[self.name].trigger(Operations.LIST_ADD, + instance._state.dirty[self.name].trigger(Operations.LIST_ADD, value, cur_value) # prevent instrumented list to perform operation - raise VICNListException + raise VICNListException def do_list_remove(self, instance, value): if instance.is_local_attribute(self.name): @@ -184,11 +183,11 @@ class Attribute(abc.ABC, ObjectSpecification): if self.is_collection: # copy the list cur_value = list(cur_value) - instance._state.dirty[self.name].trigger(Operations.LIST_REMOVE, + instance._state.dirty[self.name].trigger(Operations.LIST_REMOVE, value, cur_value) # prevent instrumented list to perform operation - raise VICNListException + raise VICNListException def do_list_clear(self, instance): if instance.is_local_attribute(self.name): @@ -198,11 +197,11 @@ class Attribute(abc.ABC, ObjectSpecification): if self.is_collection: # copy the list cur_value = list(cur_value) - instance._state.dirty[self.name].trigger(Operations.LIST_CLEAR, + instance._state.dirty[self.name].trigger(Operations.LIST_CLEAR, value, cur_value) # prevent instrumented list to perform operation - raise VICNListException + raise VICNListException def handle_getitem(self, instance, item): if isinstance(item, UUID): @@ -227,7 +226,7 @@ class Attribute(abc.ABC, ObjectSpecification): @property def is_collection(self): - return self.multiplicity in (Multiplicity.OneToMany, + return self.multiplicity in (Multiplicity.OneToMany, Multiplicity.ManyToMany) def is_set(self, instance): -- cgit 1.2.3-korg