def __init__(self, zkclient): super(ZkBackend, self).__init__(zkclient) self.acls = { '/': None, z.ALLOCATIONS: None, z.APPMONITORS: None, z.BUCKETS: None, z.CELL: None, z.IDENTITY_GROUPS: None, z.PLACEMENT: None, z.PARTITIONS: None, z.SCHEDULED: [_SERVERS_ACL_DEL], z.SCHEDULER: None, z.SERVERS: None, z.STATE_REPORTS: None, z.STRATEGIES: None, z.FINISHED: [_SERVERS_ACL], z.FINISHED_HISTORY: None, z.TRACE: None, z.TRACE_HISTORY: None, z.VERSION_ID: None, z.ZOOKEEPER: None, z.BLACKEDOUT_SERVERS: [_SERVERS_ACL], z.ENDPOINTS: [_SERVERS_ACL], z.path.endpoint_proid('root'): [_SERVERS_ACL], z.EVENTS: [_SERVERS_ACL], z.RUNNING: [_SERVERS_ACL], z.SERVER_PRESENCE: [_SERVERS_ACL], z.VERSION: [_SERVERS_ACL], z.VERSION_HISTORY: [_SERVERS_ACL], z.REBOOTS: [_SERVERS_ACL], } for path in z.trace_shards(): self.acls[path] = [_SERVERS_ACL]
def create_rootns(self): """Create root nodes and set appropriate acls.""" root_ns = [ '/', z.ALLOCATIONS, z.APPMONITORS, z.BLACKEDOUT_SERVERS, z.BUCKETS, z.CELL, z.DISCOVERY, z.DISCOVERY_STATE, z.ELECTION, z.ENDPOINTS, z.EVENTS, z.FINISHED, z.FINISHED_HISTORY, z.IDENTITY_GROUPS, z.PARTITIONS, z.PLACEMENT, z.REBOOTS, z.RUNNING, z.SCHEDULED, z.SCHEDULER, z.SERVER_PRESENCE, z.SERVERS, z.SERVER_TRACE, z.SERVER_TRACE_HISTORY, z.STATE_REPORTS, z.STRATEGIES, z.TRACE, z.TRACE_HISTORY, z.TRAITS, z.VERSION, z.VERSION_HISTORY, z.VERSION_ID, z.ZOOKEEPER, z.path.endpoint_proid('root'), ] for path in root_ns: self.backend.ensure_exists(path) for path in z.trace_shards(): self.backend.ensure_exists(path) for path in z.server_trace_shards(): self.backend.ensure_exists(path)
def create_rootns(self): """Create root nodes and set appropriate acls.""" root_ns = [ '/', z.ALLOCATIONS, z.APPMONITORS, z.BUCKETS, z.CELL, z.DISCOVERY, z.DISCOVERY_STATE, z.IDENTITY_GROUPS, z.PLACEMENT, z.PARTITIONS, z.SCHEDULED, z.SCHEDULER, z.SERVERS, z.STATE_REPORTS, z.STRATEGIES, z.FINISHED, z.FINISHED_HISTORY, z.TRACE, z.TRACE_HISTORY, z.TRAITS, z.VERSION_ID, z.ZOOKEEPER, z.BLACKEDOUT_SERVERS, z.ENDPOINTS, z.path.endpoint_proid('root'), z.EVENTS, z.RUNNING, z.SERVER_PRESENCE, z.VERSION, z.VERSION_HISTORY, z.REBOOTS, ] for path in root_ns: self.backend.ensure_exists(path) for path in z.trace_shards(): self.backend.ensure_exists(path)
def create_rootns(self): """Create root nodes and set appropriate acls.""" root_ns = { '/': None, z.ALLOCATIONS: None, z.APPMONITORS: None, z.BUCKETS: None, z.CELL: None, z.IDENTITY_GROUPS: None, z.PLACEMENT: None, z.PARTITIONS: None, z.SCHEDULED: [_SERVERS_ACL_DEL], z.SCHEDULER: None, z.SERVERS: None, z.STRATEGIES: None, z.FINISHED: [_SERVERS_ACL], z.FINISHED_HISTORY: None, z.TRACE: None, z.TRACE_HISTORY: None, z.VERSION_ID: None, z.ZOOKEEPER: None, z.BLACKEDOUT_SERVERS: [_SERVERS_ACL], z.ENDPOINTS: [_SERVERS_ACL], z.path.endpoint_proid('root'): [_SERVERS_ACL], z.EVENTS: [_SERVERS_ACL], z.RUNNING: [_SERVERS_ACL], z.SERVER_PRESENCE: [_SERVERS_ACL], z.VERSION: [_SERVERS_ACL], z.REBOOTS: [_SERVERS_ACL], } for path, acl in root_ns.items(): zkutils.ensure_exists(self.zkclient, path, acl) for path in z.trace_shards(): zkutils.ensure_exists(self.zkclient, path, acl=[_SERVERS_ACL])