Sapan Bhatia | 26d40bc | 2014-05-12 15:28:02 -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 observer.openstacksyncstep import OpenStackSyncStep |
| 6 | from core.models.network import * |
| 7 | from util.logger import Logger, logging |
| 8 | |
| 9 | logger = Logger(level=logging.INFO) |
| 10 | |
| 11 | class SyncNetworks(SyncStep): |
| 12 | provides=[Network] |
| 13 | requested_interval = 0 |
| 14 | |
| 15 | def fetch_pending(self): |
| 16 | return Network.objects.filter(Q(enacted__lt=F('updated')) | Q(enacted=None)) |
| 17 | |
| 18 | def sync_record(self, network): |
| 19 | network.save() |
| 20 | |