<s> import os <EOL> import base64 <EOL> from django . db . models import F , Q <EOL> from xos . config import Config <EOL> from synchronizers . base . openstacksyncstep import OpenStackSyncStep <EOL> from core . models . role import Role <EOL> from core . models . site import SiteRole , Controller , ControllerRole <EOL> from core . models . slice import SliceRole <EOL> from xos . logger import observer_logger as logger <EOL> class SyncRoles ( OpenStackSyncStep ) : <EOL> provides = [ Role ] <EOL> requested_interval = <NUM_LIT:0> <EOL> observes = [ SiteRole , SliceRole , ControllerRole ] <EOL> def sync_record ( self , role ) : <EOL> if not role . enacted : <EOL> controllers = Controller . objects . all ( ) <EOL> for controller in controllers : <EOL> driver = self . driver . admin_driver ( controller = controller ) <EOL> driver . create_role ( role . role ) <EOL> role . save ( ) </s>
