Attempt to provide client configuration for VPN Service
diff --git a/xos/services/vpn/models.py b/xos/services/vpn/models.py
index c6d0d11..befc586 100644
--- a/xos/services/vpn/models.py
+++ b/xos/services/vpn/models.py
@@ -22,7 +22,10 @@
sync_attributes = ("nat_ip", "nat_mac",)
- default_attributes = {'server_key': 'Error key not found'}
+ default_attributes = {'server_key': 'Error key not found',
+ 'client_conf': 'Configuration not found',
+ 'server_address': '10.8.0.1',
+ 'client_address': '10.8.0.2'}
def __init__(self, *args, **kwargs):
vpn_services = VPNService.get_service_objects().all()
@@ -73,6 +76,36 @@
def nat_mac(self):
return self.addresses.get("nat", (None, None))[1]
+ @property
+ def server_address(self):
+ return self.get_attribute(
+ 'server_address',
+ self.default_attributes['server_address'])
+
+ @server_address.setter
+ def server_address(self, value):
+ self.set_attribute("server_address", value)
+
+ @property
+ def client_address(self):
+ return self.get_attribute(
+ 'client_address',
+ self.default_attributes['client_address'])
+
+ @client_address.setter
+ def client_address(self, value):
+ self.set_attribute("client_address", value)
+
+ @property
+ def client_conf(self):
+ return self.get_attribute(
+ "client_conf",
+ self.default_attributes['client_conf'])
+
+ @client_conf.setter
+ def client_conf(self, value):
+ self.set_attribute("client_conf", value)
+
def model_policy_vpn_tenant(pk):
# This section of code is atomic to prevent race conditions