blob: c202f7415a931adfa121e3c22f64b65761be2383 [file] [log] [blame]
Scott Bakerb63ea792016-08-11 10:24:48 -07001import os
2import base64
Scott Bakerb63ea792016-08-11 10:24:48 -07003from xos.config import Config
Scott Baker8b75e852016-08-16 15:04:59 -07004from synchronizers.openstack.openstacksyncstep import OpenStackSyncStep
Scott Bakerb63ea792016-08-11 10:24:48 -07005from xos.logger import observer_logger as logger
Scott Bakeraf599eb2017-03-21 12:43:26 -07006from synchronizers.new_base.modelaccessor import *
Scott Bakerb63ea792016-08-11 10:24:48 -07007
8class SyncRoles(OpenStackSyncStep):
9 provides=[Role]
10 requested_interval=0
11 observes=[SiteRole,SliceRole,ControllerRole]
12
13 def sync_record(self, role):
14 if not role.enacted:
15 controllers = Controller.objects.all()
16 for controller in controllers:
17 driver = self.driver.admin_driver(controller=controller)
18 driver.create_role(role.role)
19 role.save()
20