blob: e7c645ec5d8f889271a2b5fe483862a0ee984e08 [file] [log] [blame]
Sapan Bhatia24836f12013-08-27 10:16:05 -04001import os
2import base64
Tony Mackae7f30c2013-09-25 12:46:50 -04003from django.db.models import F, Q
Sapan Bhatia24836f12013-08-27 10:16:05 -04004from planetstack.config import Config
Sapan Bhatia04c94ad2013-09-02 18:00:28 -04005from observer.openstacksyncstep import OpenStackSyncStep
6from core.models.site import Site
Sapan Bhatia24836f12013-08-27 10:16:05 -04007
8class SyncSites(OpenStackSyncStep):
Tony Mackdacfb982013-09-24 21:57:16 -04009 provides=[Site]
10 requested_interval=0
Tony Mack66646d52013-09-24 21:47:12 -040011
Tony Mackdacfb982013-09-24 21:57:16 -040012 def sync_record(self, site):
Tony Macke4be32f2014-03-11 20:45:25 -040013 site.save()
Sapan Bhatia24836f12013-08-27 10:16:05 -040014
Sapan Bhatia18c64cf2014-07-23 09:05:38 -040015 def delete_record(self, site):
16 site_deployments = SiteDeployments.objects.filter(site=site)
17 site_deployment_deleter = SiteDeploymentDeleter()
18 for site_deployment in site_deployments:
19 site_deployment_deleter(site_deployment.id)