blob: 097a6e90b1c8c78e01beec60baa65aa851fb3d53 [file] [log] [blame]
Sapan Bhatia511ea5f2014-07-21 22:53:58 -04001import os
2import base64
3from django.db.models import F, Q
Scott Baker76a840e2015-02-11 21:38:09 -08004from xos.config import Config
Sapan Bhatia511ea5f2014-07-21 22:53:58 -04005from 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()