blob: 76eeb1fefd5a55ee981534c10d21d6b006aed0c9 [file] [log] [blame]
Sapan Bhatia511ea5f2014-07-21 22:53:58 -04001import os
2import base64
3from django.db.models import F, Q
4from planetstack.config import Config
5from ec2_observer.syncstep import SyncStep
6from core.models.site import *
7
8class SyncDeployments(SyncStep):
9 requested_interval=86400
10 provides=[Deployment]
11
12 def fetch_pending(self,deletion):
Sapan Bhatiae7e4ca12014-07-22 01:27:02 -040013 if (deletion):
14 return []
15
Sapan Bhatia511ea5f2014-07-21 22:53:58 -040016 deployments = Deployment.objects.filter(Q(name="Amazon EC2"))
17 if (not deployments):
18 deployments = [Deployment(name="Amazon EC2")]
19 else:
20 deployments = []
21
22 return deployments
23
24 def sync_record(self, deployment):
25 deployment.save()