Revert "sort and style"
This reverts commit 0861787d95ea75b1ca4e06d7ed30c491268970e2.
diff --git a/xos/services/vpn/admin.py b/xos/services/vpn/admin.py
index 8088dad..d346ddf 100644
--- a/xos/services/vpn/admin.py
+++ b/xos/services/vpn/admin.py
@@ -124,8 +124,7 @@
vpn_subnet = forms.GenericIPAddressField(protocol="IPv4", required=True)
is_persistent = forms.BooleanField(required=False)
clients_can_see_each_other = forms.BooleanField(required=False)
- failover_servers = forms.ModelMultipleChoiceField(
- required=False, queryset=VPNTenant.get_tenant_objects())
+ failover_servers = forms.ModelMultipleChoiceField(required=False, queryset=VPNTenant.get_tenant_objects())
protocol = forms.ChoiceField(required=True, choices=[
("tcp", "tcp"), ("udp", "udp")])
use_ca_from = forms.ModelChoiceField(
@@ -241,18 +240,18 @@
certificate = self.certificate_name(obj)
# If the client has already been reovked don't do it again
if (os.path.isfile(obj.tenant.pki_dir +
- "/issued/" + certificate + ".crt")):
+ "/issued/" + certificate + ".crt")):
VPNService.execute_easyrsa_command(
obj.tenant.pki_dir, "revoke " + certificate)
# Revoking a client cert does not delete any of the files
# to make sure that we can add this user again we need to
# delete all of the files created by easyrsa
os.remove(obj.tenant.pki_dir +
- "/issued/" + certificate + ".crt")
+ "/issued/" + certificate + ".crt")
os.remove(obj.tenant.pki_dir +
- "/private/" + certificate + ".key")
+ "/private/" + certificate + ".key")
os.remove(obj.tenant.pki_dir +
- "/reqs/" + certificate + ".req")
+ "/reqs/" + certificate + ".req")
obj.tenant.enacted = None
obj.tenant.save()
@@ -268,7 +267,7 @@
certificate = self.certificate_name(obj)
# Only add a certificate if ones does not yet exist
if (not os.path.isfile(obj.tenant.pki_dir +
- "/issued/" + certificate + ".crt")):
+ "/issued/" + certificate + ".crt")):
VPNService.execute_easyrsa_command(
obj.tenant.pki_dir,
"build-client-full " + certificate + " nopass")
diff --git a/xos/services/vpn/models.py b/xos/services/vpn/models.py
index 77705d0..0070d76 100644
--- a/xos/services/vpn/models.py
+++ b/xos/services/vpn/models.py
@@ -295,10 +295,10 @@
"key " + client_name + ".key\n" +
"verb 3\n" +
self.get_remote_line(
- self.nat_ip, self.port_number, self.protocol))
+ self.nat_ip, self.port_number, self.protocol))
for remote in self.failover_servers:
conf += self.get_remote_line(
- remote.nat_ip, remote.port_number, remote.protocol)
+ remote.nat_ip, remote.port_number, remote.protocol)
if self.is_persistent:
conf += "persist-tun\n"
diff --git a/xos/synchronizers/vpn/steps/sync_vpntenant.py b/xos/synchronizers/vpn/steps/sync_vpntenant.py
index fc1e695..7538628 100644
--- a/xos/synchronizers/vpn/steps/sync_vpntenant.py
+++ b/xos/synchronizers/vpn/steps/sync_vpntenant.py
@@ -19,6 +19,7 @@
template_name = "sync_vpntenant.yaml"
service_key_name = "/opt/xos/synchronizers/vpn/vpn_private_key"
+
def sync_fields(self, tenant, fields):
tenant.pki_dir = (
VPNService.OPENVPN_PREFIX + "server-" + str(result.id))