CORD-2648 convert core attics to decl
Change-Id: I7146244bfa468bbd9c9bba77708262749842aa53
diff --git a/xos/xos_client/xosapi/convenience/slice.py b/xos/xos_client/xosapi/convenience/slice.py
index 7686129..8431bd2 100644
--- a/xos/xos_client/xosapi/convenience/slice.py
+++ b/xos/xos_client/xosapi/convenience/slice.py
@@ -15,7 +15,7 @@
import json
-from xosapi.orm import ORMWrapper, register_convenience_wrapper
+from xosapi.orm import ORMWrapper, ORMLocalObjectManager, register_convenience_wrapper
class ORMWrapperSlice(ORMWrapper):
# TODO: this looks to be incorrect
@@ -23,4 +23,10 @@
def slicename(self):
return "%s_%s" % (self.site.login_base, self.name)
+ # networks - emulates the ManyToMany from Slice to Network via NetworkSlice
+ @property
+ def networks(self):
+ idList = [x.network.id for x in self.networkslices.all()]
+ return ORMLocalObjectManager(self.stub, "Network", idList, False)
+
register_convenience_wrapper("Slice", ORMWrapperSlice)