blob: 7964dd9219c28655e09b9db908bf43491d3b8a4e [file] [log] [blame]
import os
import base64
from django.db.models import F, Q
from planetstack.config import Config
from observer.openstacksyncstep import OpenStackSyncStep
from core.models.network import *
from util.logger import Logger, logging
logger = Logger(level=logging.INFO)
class SyncNetworks(OpenStackSyncStep):
provides=[Network]
requested_interval = 0
def sync_record(self, network):
network.save()
def delete_record(self, network):
network_deployment_deleter = NetworkDeploymentDeleter()
for network_deployment in NetworkDeployments.objects.filter(network=network):
try:
network_deployment_deleter(network_deployment.id)
except Exeption,e:
logger.log_exc("Failed to delete network deployment %s" % network_deployment)
raise e
network.delete()