blob: e19532e5896f84b67cb372957796a52c5f492e55 [file] [log] [blame]
Andy Bavier89a95422016-11-02 14:38:39 -04001import os
2import base64
3from django.db.models import F, Q
4from xos.config import Config
5from core.models.role import Role
6from core.models.site import SiteRole, Controller, ControllerRole
7from core.models.slice import SliceRole
8from xos.logger import observer_logger as logger
9from synchronizers.base.ansible import *
10from synchronizers.base.syncstep import *
11
12class SyncRoles(SyncStep):
13 provides=[Role]
14 requested_interval=0
15 observes=[SiteRole,SliceRole,ControllerRole]
16
17 def sync_record(self, role):
18 if not role.enacted:
19 controllers = Controller.objects.all()
20 """
21 for controller in controllers:
22 driver = self.driver.admin_driver(controller=controller)
23 driver.create_role(role.role)
24 """
25 role.save()
26