[SEBA-450] (part 2)
Add tox testing support on additional XOS library modules:
- xos-api
- xos-kafka (has no tests)
- xos-migrate (has no tests)
- xos-synchronizer
Change-Id: I98195bc9747971d3515882d517affe058dd86ac5
diff --git a/lib/xos-api/xosapi/convenience/addresspool.py b/lib/xos-api/xosapi/convenience/addresspool.py
index 13006c5..e83c818 100644
--- a/lib/xos-api/xosapi/convenience/addresspool.py
+++ b/lib/xos-api/xosapi/convenience/addresspool.py
@@ -13,6 +13,8 @@
# limitations under the License.
+from __future__ import absolute_import
+
from xosapi.orm import ORMWrapper, register_convenience_wrapper
diff --git a/lib/xos-api/xosapi/convenience/controller.py b/lib/xos-api/xosapi/convenience/controller.py
index 437b54a..4e13dac 100644
--- a/lib/xos-api/xosapi/convenience/controller.py
+++ b/lib/xos-api/xosapi/convenience/controller.py
@@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+from __future__ import absolute_import
+
from xosapi.orm import ORMWrapper, register_convenience_wrapper
diff --git a/lib/xos-api/xosapi/convenience/instance.py b/lib/xos-api/xosapi/convenience/instance.py
index 3941643..f373f12 100644
--- a/lib/xos-api/xosapi/convenience/instance.py
+++ b/lib/xos-api/xosapi/convenience/instance.py
@@ -13,6 +13,8 @@
# limitations under the License.
+from __future__ import absolute_import
+
from xosapi.orm import ORMWrapper, register_convenience_wrapper
diff --git a/lib/xos-api/xosapi/convenience/network.py b/lib/xos-api/xosapi/convenience/network.py
index ffa89f7..95cb972 100644
--- a/lib/xos-api/xosapi/convenience/network.py
+++ b/lib/xos-api/xosapi/convenience/network.py
@@ -12,7 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-from xosapi.orm import ORMWrapper, ORMLocalObjectManager, register_convenience_wrapper
+from __future__ import absolute_import
+
+from xosapi.orm import (ORMLocalObjectManager, ORMWrapper,
+ register_convenience_wrapper)
class ORMWrapperNetwork(ORMWrapper):
diff --git a/lib/xos-api/xosapi/convenience/onosapp.py b/lib/xos-api/xosapi/convenience/onosapp.py
index fd791a8..2970581 100644
--- a/lib/xos-api/xosapi/convenience/onosapp.py
+++ b/lib/xos-api/xosapi/convenience/onosapp.py
@@ -12,8 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-from xosapi.orm import register_convenience_wrapper
+from __future__ import absolute_import
+
from xosapi.convenience.serviceinstance import ORMWrapperServiceInstance
+from xosapi.orm import register_convenience_wrapper
class ORMWrapperONOSApp(ORMWrapperServiceInstance):
diff --git a/lib/xos-api/xosapi/convenience/port.py b/lib/xos-api/xosapi/convenience/port.py
index 61e7377..2c9b9a6 100644
--- a/lib/xos-api/xosapi/convenience/port.py
+++ b/lib/xos-api/xosapi/convenience/port.py
@@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+from __future__ import absolute_import
+
from xosapi.orm import ORMWrapper, register_convenience_wrapper
diff --git a/lib/xos-api/xosapi/convenience/privilege.py b/lib/xos-api/xosapi/convenience/privilege.py
index 9bdb635..0071842 100644
--- a/lib/xos-api/xosapi/convenience/privilege.py
+++ b/lib/xos-api/xosapi/convenience/privilege.py
@@ -13,6 +13,8 @@
# limitations under the License.
+from __future__ import absolute_import
+
from xosapi.orm import ORMWrapper, register_convenience_wrapper
diff --git a/lib/xos-api/xosapi/convenience/service.py b/lib/xos-api/xosapi/convenience/service.py
index ab82908..8c9985a 100644
--- a/lib/xos-api/xosapi/convenience/service.py
+++ b/lib/xos-api/xosapi/convenience/service.py
@@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+from __future__ import absolute_import
+
from xosapi.orm import ORMWrapper, register_convenience_wrapper
diff --git a/lib/xos-api/xosapi/convenience/serviceinstance.py b/lib/xos-api/xosapi/convenience/serviceinstance.py
index 33ab553..10adb16 100644
--- a/lib/xos-api/xosapi/convenience/serviceinstance.py
+++ b/lib/xos-api/xosapi/convenience/serviceinstance.py
@@ -11,10 +11,11 @@
# limitations under the License.
-from xosapi.orm import ORMWrapper, register_convenience_wrapper
+from __future__ import absolute_import
-from xosconfig import Config
from multistructlog import create_logger
+from xosapi.orm import ORMWrapper, register_convenience_wrapper
+from xosconfig import Config
log = create_logger(Config().get("logging"))
@@ -28,11 +29,6 @@
return attrs
@property
- def tenantattribute_dict(self):
- log.warn("tenantattribute_dict method is deprecated")
- return self.serviceinstanceattribute_dict
-
- @property
def westbound_service_instances(self):
links = self.provided_links.all()
instances = []
@@ -50,32 +46,6 @@
return instances
- def create_eastbound_instance(self):
-
- # Already has a chain
- if len(self.eastbound_service_instances) > 0 and not self.is_new:
- log.debug("MODEL_POLICY: Subscriber %s is already part of a chain" % si.id)
- return
-
- # if it does not have a chain,
- # Find links to the next element in the service chain
- # and create one
-
- links = self.owner.subscribed_dependencies.all()
-
- for link in links:
- si_class = link.provider_service.get_service_instance_class_name()
- log.info(" %s creating %s" % (self.model_name, si_class))
-
- eastbound_si_class = model_accessor.get_model_class(si_class)
- eastbound_si = eastbound_si_class()
- eastbound_si.owner_id = link.provider_service_id
- eastbound_si.save()
- link = ServiceInstanceLink(
- provider_service_instance=eastbound_si, subscriber_service_instance=si
- )
- link.save()
-
def get_westbound_service_instance_properties(self, prop_name, include_self=False):
if include_self and hasattr(self, prop_name):
return getattr(self, prop_name)
diff --git a/lib/xos-api/xosapi/convenience/slice.py b/lib/xos-api/xosapi/convenience/slice.py
index abdd485..0a10311 100644
--- a/lib/xos-api/xosapi/convenience/slice.py
+++ b/lib/xos-api/xosapi/convenience/slice.py
@@ -12,7 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-from xosapi.orm import ORMWrapper, ORMLocalObjectManager, register_convenience_wrapper
+from __future__ import absolute_import
+
+from xosapi.orm import (ORMLocalObjectManager, ORMWrapper,
+ register_convenience_wrapper)
class ORMWrapperSlice(ORMWrapper):
diff --git a/lib/xos-api/xosapi/convenience/tag.py b/lib/xos-api/xosapi/convenience/tag.py
index aaeaf65..eb6490f 100644
--- a/lib/xos-api/xosapi/convenience/tag.py
+++ b/lib/xos-api/xosapi/convenience/tag.py
@@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+from __future__ import absolute_import
+
from xosapi.orm import ORMWrapper, register_convenience_wrapper
diff --git a/lib/xos-api/xosapi/convenience/user.py b/lib/xos-api/xosapi/convenience/user.py
index 3205680..7dda414 100644
--- a/lib/xos-api/xosapi/convenience/user.py
+++ b/lib/xos-api/xosapi/convenience/user.py
@@ -12,7 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+from __future__ import absolute_import
+
import hashlib
+
from xosapi.orm import ORMWrapper, register_convenience_wrapper