Sort and style
diff --git a/xos/services/vpn/admin.py b/xos/services/vpn/admin.py
index 133b747..593bd1a 100644
--- a/xos/services/vpn/admin.py
+++ b/xos/services/vpn/admin.py
@@ -153,7 +153,7 @@
self.fields['is_persistent'].initial = self.instance.is_persistent
self.initial['protocol'] = self.instance.protocol
self.initial['failover_servers'] = VPNTenant.get_tenant_objects().filter(
- pk__in=self.instance.failover_server_ids)
+ pk__in=self.instance.failover_server_ids)
self.fields['failover_servers'].queryset = (
VPNTenant.get_tenant_objects().exclude(pk=self.instance.pk))
self.fields['use_ca_from'].queryset = (
@@ -196,7 +196,8 @@
self.instance.protocol))
if (self.cleaned_data.get('use_ca_from')):
- self.instance.use_ca_from_id = self.cleaned_data.get('use_ca_from').id
+ self.instance.use_ca_from_id = self.cleaned_data.get(
+ 'use_ca_from').id
result.save() # Need to do this so that we know the ID
@@ -209,9 +210,11 @@
VPNService.execute_easyrsa_command(
self.instance.pki_dir, "--req-cn=XOS build-ca nopass")
if (self.instance.use_ca_from_id):
- tenant = VPNTenant.get_tenant_objects().filter(pk=self.instance.use_ca_from_id)[0]
+ tenant = VPNTenant.get_tenant_objects().filter(
+ pk=self.instance.use_ca_from_id)[0]
shutil.copy2(tenant.pki_dir + "/ca.crt", self.instance.pki_dir)
- shutil.copy2(tenant.pki_dir + "/private/ca.key", self.instance.pki_dir + "/private")
+ shutil.copy2(tenant.pki_dir + "/private/ca.key",
+ self.instance.pki_dir + "/private")
result.ca_crt = self.generate_ca_crt()
diff --git a/xos/synchronizers/vpn/steps/sync_tenantprivilege.py b/xos/synchronizers/vpn/steps/sync_tenantprivilege.py
index 2595eff..65baeda 100644
--- a/xos/synchronizers/vpn/steps/sync_tenantprivilege.py
+++ b/xos/synchronizers/vpn/steps/sync_tenantprivilege.py
@@ -1,7 +1,7 @@
import os
import sys
-from django.db.models import F, Q
+from core.models import TenantPrivilege
from services.vpn.models import VPN_KIND, VPNService, VPNTenant
from synchronizers.base.syncstep import SyncStep
@@ -36,7 +36,8 @@
tenant = VPNTenant.get_tenant_objects().filter(pk=record.tenant.id)[0]
# If the client has already been reovked don't do it again
if (os.path.isfile(tenant.pki_dir + "/issued/" + certificate + ".crt")):
- VPNService.execute_easyrsa_command(tenant.pki_dir, "revoke " + certificate)
+ VPNService.execute_easyrsa_command(
+ 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