Maybe fix the service finally
diff --git a/xos/helloworldservice/models.py b/xos/helloworldservice/models.py
index ee3fb2f..ed09e50 100644
--- a/xos/helloworldservice/models.py
+++ b/xos/helloworldservice/models.py
@@ -16,7 +16,8 @@
proxy = True
KIND = HELLO_WORLD_KIND
- sync_attributes = ("nat_ip", "nat_mac",)
+ sync_attributes = ("private_ip", "private_mac",
+ "nat_ip", "nat_mac",)
default_attributes = {'display_message': 'Hello World!'}
def __init__(self, *args, **kwargs):
@@ -52,6 +53,8 @@
for ns in self.instance.ports.all():
if "nat" in ns.network.name.lower():
addresses["nat"] = (ns.ip, ns.mac)
+ elif "private" in ns.network.name.lower():
+ addresses["private"] = (ns.ip, ns.mac)
return addresses
@property
@@ -62,6 +65,14 @@
def nat_mac(self):
return self.addresses.get("nat", (None, None))[1]
+ @property
+ def private_ip(self):
+ return self.addresses.get("private", (None, None))[0]
+
+ @property
+ def private_mac(self):
+ return self.addresses.get("private", (None, None))[1]
+
def model_policy_helloworld_tenant(pk):
with transaction.atomic():
tenant = HelloWorldTenant.objects.select_for_update().filter(pk=pk)