X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=PLC%2FSliceInstantiations.py;h=f03b119c8cd487bc4f8bd560242998c8c5053f50;hb=f7ce7ce813d4c44502629820a3583f32a99a98f7;hp=1087e32aff734f967aea19b7c1d03b29db9aee1d;hpb=9a608e111c7f8182f51753ea3f563ebc19eb4c71;p=plcapi.git diff --git a/PLC/SliceInstantiations.py b/PLC/SliceInstantiations.py index 1087e32..f03b119 100644 --- a/PLC/SliceInstantiations.py +++ b/PLC/SliceInstantiations.py @@ -26,17 +26,17 @@ class SliceInstantiation(Row): } def validate_instantiation(self, instantiation): - # Make sure name is not blank + # Make sure name is not blank if not len(instantiation): raise PLCInvalidArgument, "Slice instantiation state name must be specified" - - # Make sure slice instantiation does not alredy exist - conflicts = SliceInstantiations(self.api, [instantiation]) + + # Make sure slice instantiation does not alredy exist + conflicts = SliceInstantiations(self.api, [instantiation]) if conflicts: raise PLCInvalidArgument, "Slice instantiation state name already in use" - return instantiation - + return instantiation + class SliceInstantiations(Table): """ Representation of the slice_instantiations table in the database. @@ -47,7 +47,7 @@ class SliceInstantiations(Table): sql = "SELECT %s FROM slice_instantiations" % \ ", ".join(SliceInstantiation.fields) - + if instantiations: sql += " WHERE instantiation IN (%s)" % ", ".join(map(api.db.quote, instantiations))