blob: c202f7415a931adfa121e3c22f64b65761be2383 [file] [log] [blame]
import os
import base64
from xos.config import Config
from synchronizers.openstack.openstacksyncstep import OpenStackSyncStep
from xos.logger import observer_logger as logger
from synchronizers.new_base.modelaccessor import *
class SyncRoles(OpenStackSyncStep):
provides=[Role]
requested_interval=0
observes=[SiteRole,SliceRole,ControllerRole]
def sync_record(self, role):
if not role.enacted:
controllers = Controller.objects.all()
for controller in controllers:
driver = self.driver.admin_driver(controller=controller)
driver.create_role(role.role)
role.save()