def is_supported(dataset, data_name): # Support wildcard like storage.* and !disk.* # Start with negation, we consider that the order is deny, allow if any(utils.match(data_name, datapoint[1:]) for datapoint in dataset if datapoint[0] == '!'): return False if any(utils.match(data_name, datapoint) for datapoint in dataset if datapoint[0] != '!'): return True # if we only have negation, we suppose the default is allow return all(datapoint.startswith('!') for datapoint in dataset)
def _match(pollster): """Find out if pollster name matches to one of the list.""" return any(utils.match(pollster.name, pattern) for pattern in pollster_list)
def get(self, metric_name): if self.cfg is not None: for metric, policy in self.cfg.items(): # Support wild cards such as disk.* if utils.match(metric_name, metric): return policy
def match(self, metric_name): for t in self.cfg['metrics']: if utils.match(metric_name, t): return True return False
def _match(pollster): """Find out if pollster name matches to one of the list.""" return any( utils.match(pollster.name, pattern) for pattern in pollster_list)
def match_type(self, meter_name): for t in self._event_type: if utils.match(meter_name, t): return True
def excluded_type(self, event_type): for t in self._excluded_types: if utils.match(event_type, t): return True return False