punch MAC addresses through into vcpetenant object
diff --git a/xos/cord/models.py b/xos/cord/models.py
index 995ec4f..7cf58e7 100644
--- a/xos/cord/models.py
+++ b/xos/cord/models.py
@@ -463,12 +463,11 @@
KIND = VCPE_KIND
- sync_attributes = ("nat_ip",
- "lan_ip",
- "wan_ip",
- "private_ip",
- "hpc_client_ip",
- "wan_mac")
+ sync_attributes = ("nat_ip", "nat_mac",
+ "lan_ip", "lan_mac",
+ "wan_ip", "wan_mac",
+ "private_ip", "private_mac",
+ "hpc_client_ip", "hpc_client_mac")
default_attributes = {"sliver_id": None,
"users": [],
@@ -601,28 +600,36 @@
addresses = {}
for ns in self.sliver.ports.all():
if "lan" in ns.network.name.lower():
- addresses["lan"] = ns.ip
+ addresses["lan"] = (ns.ip, ns.mac)
elif "wan" in ns.network.name.lower():
- addresses["wan"] = ns.ip
+ addresses["wan"] = (ns.ip, ns.mac)
elif "private" in ns.network.name.lower():
- addresses["private"] = ns.ip
+ addresses["private"] = (ns.ip, ns.mac)
elif "nat" in ns.network.name.lower():
- addresses["nat"] = ns.ip
+ addresses["nat"] = (ns.ip, ns.mac)
elif "hpc_client" in ns.network.name.lower():
- addresses["hpc_client"] = ns.ip
+ addresses["hpc_client"] = (ns.ip, ns.mac)
return addresses
@property
def nat_ip(self):
- return self.addresses.get("nat",None)
+ return self.addresses.get("nat", (None,None) )[0]
+
+ @property
+ def nat_mac(self):
+ return self.addresses.get("nat", (None,None) )[1]
@property
def lan_ip(self):
- return self.addresses.get("lan",None)
+ return self.addresses.get("lan", (None, None) )[0]
+
+ @property
+ def lan_mac(self):
+ return self.addresses.get("lan", (None, None) )[1]
@property
def wan_ip(self):
- return self.addresses.get("wan",None)
+ return self.addresses.get("wan", (None, None) )[0]
@property
def wan_mac(self):
@@ -638,11 +645,19 @@
@property
def private_ip(self):
- return self.addresses.get("private",None)
+ return self.addresses.get("private", (None, None) )[0]
+
+ @property
+ def private_mac(self):
+ return self.addresses.get("private", (None, None) )[1]
@property
def hpc_client_ip(self):
- return self.addresses.get("hpc_client",None)
+ return self.addresses.get("hpc_client", (None, None) )[0]
+
+ @property
+ def hpc_client_mac(self):
+ return self.addresses.get("hpc_client", (None, None) )[1]
@property
def is_synced(self):