Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if args.metrics_file and args.metrics_file[0] != '-':
fi = args.metrics_file
metrics = map(lambda s: s.strip(), fileinput.input(fi))
else:
metrics = map(lambda s: s.strip(), fileinput.input([]))
metrics_count = 0
for metric in metrics:
name, t = metric.strip().split('|')
mode = AGGREGATION[t]
if mode is not None:
cname = name.replace('.', '/')
path = os.path.join(args.storage_dir, cname + '.wsp')
metrics_count = metrics_count + setAggregation(path, mode)
logging.info('Successfully set aggregation mode for ' +
'%d of %d metrics' % (metrics_count, len(metrics)))
if args.metrics_file and args.metrics_file[0] != '-':
fi = args.metrics_file
metrics = map(lambda s: s.strip(), fileinput.input(fi))
else:
metrics = map(lambda s: s.strip(), fileinput.input([]))
metrics_count = 0
for metric in metrics:
name, t = metric.strip().split('|')
mode = AGGREGATION[t]
if mode is not None:
cname = name.replace('.', '/')
path = os.path.join(args.storage_dir, cname + '.wsp')
metrics_count = metrics_count + setAggregation(path, mode)
logging.info('Successfully set aggregation mode for ' +
'%d of %d metrics' % (metrics_count, len(metrics)))