removing plural from model names. some cleanup
diff --git a/planetstack/ec2_observer/deleters/__init__.py b/planetstack/ec2_observer/deleters/__init__.py
old mode 100755
new mode 100644
diff --git a/planetstack/ec2_observer/deleters/site_deleter.py b/planetstack/ec2_observer/deleters/site_deleter.py
index b8ca6a1..88a4008 100644
--- a/planetstack/ec2_observer/deleters/site_deleter.py
+++ b/planetstack/ec2_observer/deleters/site_deleter.py
@@ -1,14 +1,14 @@
-from core.models import Site, SiteDeployments
+from core.models import Site, SiteDeployment
from observer.deleter import Deleter
-from observer.deleters.site_deployment_deleter import SiteDeploymentsDeleter
+from observer.deleters.site_deployment_deleter import SiteDeploymentDeleter
class SiteDeleter(Deleter):
model='Site'
def call(self, pk):
site = Site.objects.get(pk=pk)
- site_deployments = SiteDeployments.objects.filter(site=site)
- site_deployment_deleter = SiteDeploymentsDeleter()
+ site_deployments = SiteDeployment.objects.filter(site=site)
+ site_deployment_deleter = SiteDeploymentDeleter()
for site_deployment in site_deployments:
site_deployment_deleter(site_deployment.id)
site.delete()
diff --git a/planetstack/ec2_observer/deleters/site_deployment_deleter.py b/planetstack/ec2_observer/deleters/site_deployment_deleter.py
index cc71d43..db344cd 100644
--- a/planetstack/ec2_observer/deleters/site_deployment_deleter.py
+++ b/planetstack/ec2_observer/deleters/site_deployment_deleter.py
@@ -1,11 +1,11 @@
-from core.models import Site, SiteDeployments
+from core.models import Site, SiteDeployment
from observer.deleter import Deleter
-class SiteDeploymentsDeleter(Deleter):
- model='SiteDeployments'
+class SiteDeploymentDeleter(Deleter):
+ model='SiteDeployment'
def call(self, pk):
- site_deployment = SiteDeployments.objects.get(pk=pk)
+ site_deployment = SiteDeployment.objects.get(pk=pk)
if site_deployment.tenant_id:
driver = self.driver.admin_driver(deployment=site_deployment.deployment.name)
driver.delete_tenant(site_deployment.tenant_id)
diff --git a/planetstack/ec2_observer/dmdot b/planetstack/ec2_observer/dmdot
old mode 100755
new mode 100644
diff --git a/planetstack/ec2_observer/event_loop.py b/planetstack/ec2_observer/event_loop.py
index 1f15a8e..1319fec 100644
--- a/planetstack/ec2_observer/event_loop.py
+++ b/planetstack/ec2_observer/event_loop.py
@@ -49,7 +49,7 @@
return ig
class PlanetStackObserver:
- #sync_steps = [SyncNetworks,SyncNetworkSlivers,SyncSites,SyncSitePrivileges,SyncSlices,SyncSliceMemberships,SyncSlivers,SyncSliverIps,SyncExternalRoutes,SyncUsers,SyncRoles,SyncNodes,SyncImages,GarbageCollector]
+ #sync_steps = [SyncNetworks,SyncNetworkSlivers,SyncSites,SyncSitePrivilege,SyncSlices,SyncSliceMemberships,SyncSlivers,SyncSliverIps,SyncExternalRoutes,SyncUsers,SyncRoles,SyncNodes,SyncImages,GarbageCollector]
sync_steps = []
diff --git a/planetstack/ec2_observer/start.sh b/planetstack/ec2_observer/start.sh
old mode 100755
new mode 100644
diff --git a/planetstack/ec2_observer/steps/__init__.py b/planetstack/ec2_observer/steps/__init__.py
index e56c4b1..ed44fdb 100644
--- a/planetstack/ec2_observer/steps/__init__.py
+++ b/planetstack/ec2_observer/steps/__init__.py
@@ -2,7 +2,7 @@
#from .sync_network_slivers import SyncNetworkSlivers
#from .sync_networks import SyncNetworks
#from .sync_network_deployments import SyncNetworkDeployments
-#from .sync_site_privileges import SyncSitePrivileges
+#from .sync_site_privileges import SyncSitePrivilege
#from .sync_slice_memberships import SyncSliceMemberships
#from .sync_slices import SyncSlices
#from .sync_sliver_ips import SyncSliverIps
diff --git a/planetstack/ec2_observer/steps/sync_nodes.py b/planetstack/ec2_observer/steps/sync_nodes.py
index 9f032ed..0fa8b61 100644
--- a/planetstack/ec2_observer/steps/sync_nodes.py
+++ b/planetstack/ec2_observer/steps/sync_nodes.py
@@ -20,7 +20,7 @@
return []
deployment = Deployment.objects.filter(Q(name="Amazon EC2"))[0]
- current_site_deployments = SiteDeployments.objects.filter(Q(deployment=deployment))
+ current_site_deployments = SiteDeployment.objects.filter(Q(deployment=deployment))
zone_ret = aws_run('ec2 describe-availability-zones')
zones = zone_ret['AvailabilityZones']
diff --git a/planetstack/ec2_observer/steps/sync_site_deployments.py b/planetstack/ec2_observer/steps/sync_site_deployments.py
index 7c24f68..5adccb7 100644
--- a/planetstack/ec2_observer/steps/sync_site_deployments.py
+++ b/planetstack/ec2_observer/steps/sync_site_deployments.py
@@ -7,9 +7,9 @@
from ec2_observer.awslib import *
import pdb
-class SyncSiteDeployments(SyncStep):
+class SyncSiteDeployment(SyncStep):
requested_interval=86400
- provides=[SiteDeployments]
+ provides=[SiteDeployment]
def fetch_pending(self, deletion):
if (deletion):
@@ -29,7 +29,7 @@
# The syncstep should catch it
# At any rate, we should not run if there are no deployments
deployment = Deployment.objects.filter(Q(name="Amazon EC2"))[0]
- current_site_deployments = SiteDeployments.objects.filter(Q(deployment=deployment))
+ current_site_deployments = SiteDeployment.objects.filter(Q(deployment=deployment))
site_dict = {}
for sd in current_site_deployments:
@@ -40,7 +40,7 @@
try:
site_record = site_dict[site]
except KeyError:
- sd = SiteDeployments(site=site,deployment=deployment,tenant_id=base64.urlsafe_b64encode(os.urandom(12)))
+ sd = SiteDeployment(site=site,deployment=deployment,tenant_id=base64.urlsafe_b64encode(os.urandom(12)))
updated_site_deployments.append(sd)
return updated_site_deployments
diff --git a/planetstack/ec2_observer/steps/sync_sites.py b/planetstack/ec2_observer/steps/sync_sites.py
index 0c1c7cf..0959c71 100644
--- a/planetstack/ec2_observer/steps/sync_sites.py
+++ b/planetstack/ec2_observer/steps/sync_sites.py
@@ -16,7 +16,7 @@
return []
deployment = Deployment.objects.filter(Q(name="Amazon EC2"))[0]
- current_site_deployments = SiteDeployments.objects.filter(Q(deployment=deployment))
+ current_site_deployments = SiteDeployment.objects.filter(Q(deployment=deployment))
zone_ret = aws_run('ec2 describe-availability-zones')
zones = zone_ret['AvailabilityZones']