Sapan Bhatia | 511ea5f | 2014-07-21 22:53:58 -0400 | [diff] [blame^] | 1 | import os |
| 2 | import base64 |
| 3 | from django.db.models import F, Q |
| 4 | from planetstack.config import Config |
| 5 | from ec2_observer.syncstep import SyncStep |
| 6 | from core.models.site import * |
| 7 | |
| 8 | class SyncDeployments(SyncStep): |
| 9 | requested_interval=86400 |
| 10 | provides=[Deployment] |
| 11 | |
| 12 | def fetch_pending(self,deletion): |
| 13 | deployments = Deployment.objects.filter(Q(name="Amazon EC2")) |
| 14 | if (not deployments): |
| 15 | deployments = [Deployment(name="Amazon EC2")] |
| 16 | else: |
| 17 | deployments = [] |
| 18 | |
| 19 | return deployments |
| 20 | |
| 21 | def sync_record(self, deployment): |
| 22 | deployment.save() |