soften dependency between tosca/network.py and vrouter service
diff --git a/xos/onboard/vrouter/models.py b/xos/onboard/vrouter/models.py
index 05b57e2..d302b13 100644
--- a/xos/onboard/vrouter/models.py
+++ b/xos/onboard/vrouter/models.py
@@ -15,8 +15,12 @@
class ConfigurationError(Exception):
pass
+
VROUTER_KIND = "vROUTER"
+# NOTE: don't change VROUTER_KIND unless you also change the reference to it
+# in tosca/resources/network.py
+
CORD_USE_VTN = getattr(Config(), "networking_use_vtn", False)
class VRouterService(Service):
diff --git a/xos/tosca/resources/network.py b/xos/tosca/resources/network.py
index fc143d0..8672b76 100644
--- a/xos/tosca/resources/network.py
+++ b/xos/tosca/resources/network.py
@@ -72,8 +72,8 @@
if existing_tenancy:
self.info("Tenancy relationship from %s to %s already exists" % (str(obj), str(provider_service)))
else:
- from services.vrouter.models import VROUTER_KIND, VRouterService
- if provider_service.kind == VROUTER_KIND:
+ if provider_service.kind == "vROUTER":
+ from services.vrouter.models import VRouterService
tenancy = VRouterService.objects.get(id=provider_service.id).get_tenant(address_pool_name="addresses_"+obj.name, subscriber_network=obj)
tenancy.save()
obj.subnet = tenancy.cidr