def __init__(self, *args, **kwargs): super(Module, self).__init__(*args, **kwargs) _global_instance['plugin'] = self self.log.info("Constructing module {0}: instance {1}".format( __name__, _global_instance)) self.log_primed = False self.log_buffer = collections.deque(maxlen=LOG_BUFFER_SIZE) self.audit_buffer = collections.deque(maxlen=LOG_BUFFER_SIZE) # Keep a librados instance for those that need it. self._rados = None # Stateful instances of RbdLs, hold cached results. Key to dict # is pool name. self.rbd_ls = {} # Stateful instance of RbdPoolLs, hold cached list of RBD # pools self.rbd_pool_ls = RbdPoolLs(self) # Stateful instances of CephFSClients, hold cached results. Key to # dict is FSCID self.cephfs_clients = {} # A short history of pool df stats self.pool_stats = defaultdict( lambda: defaultdict(lambda: collections.deque(maxlen=10)))
def __init__(self, *args, **kwargs): super(Module, self).__init__(*args, **kwargs) _global_instance['plugin'] = self self.log.info("Constructing module {0}: instance {1}".format( __name__, _global_instance)) self.log_primed = False self.log_buffer = collections.deque(maxlen=LOG_BUFFER_SIZE) self.audit_buffer = collections.deque(maxlen=LOG_BUFFER_SIZE) # Keep a librados instance for those that need it. self._rados = None # Stateful instances of RbdLs, hold cached results. Key to dict # is pool name. self.rbd_ls = {} # Stateful instance of RbdPoolLs, hold cached list of RBD # pools self.rbd_pool_ls = RbdPoolLs(self) # Stateful instance of RbdISCSI self.rbd_iscsi = rbd_iscsi.Controller(self) # Stateful instance of RbdMirroring, hold cached results. self.rbd_mirroring = rbd_mirroring.Controller(self) # Stateful instances of CephFSClients, hold cached results. Key to # dict is FSCID self.cephfs_clients = {} # Stateful instance of RGW self.rgw_daemons = RGWDaemons(self) # A short history of pool df stats self.pool_stats = defaultdict(lambda: defaultdict( lambda: collections.deque(maxlen=10))) # A prefix for all URLs to use the dashboard with a reverse http proxy self.url_prefix = ''