push wan_mac through to vcpe observer
diff --git a/xos/cord/models.py b/xos/cord/models.py
index 7977f22..ca010cb 100644
--- a/xos/cord/models.py
+++ b/xos/cord/models.py
@@ -225,7 +225,8 @@
"lan_ip",
"wan_ip",
"private_ip",
- "hpc_client_ip")
+ "hpc_client_ip",
+ "wan_mac")
default_attributes = {"firewall_enable": False,
"firewall_rules": "accept all anywhere anywhere",
@@ -493,6 +494,18 @@
return self.addresses.get("wan",None)
@property
+ def wan_mac(self):
+ ip = self.wan_ip
+ if not ip:
+ return None
+ try:
+ (a,b,c,d) = ip.split('.')
+ wan_mac = "02:42:%2x:%2x:%2x:%2x" % (int(a), int(b), int(c), int(d))
+ except:
+ wan_mac = "Exception"
+ return wan_mac
+
+ @property
def private_ip(self):
return self.addresses.get("private",None)
diff --git a/xos/observers/vcpe/steps/sync_vcpetenant.yaml b/xos/observers/vcpe/steps/sync_vcpetenant.yaml
index 6decb95..3593020 100644
--- a/xos/observers/vcpe/steps/sync_vcpetenant.yaml
+++ b/xos/observers/vcpe/steps/sync_vcpetenant.yaml
@@ -25,6 +25,7 @@
wan_ip: {{ wan_ip }}
private_ip: {{ private_ip }}
hpc_client_ip: {{ hpc_client_ip }}
+ wan_mac: {{ wan_mac }}
tasks:
- name: Docker repository