Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
node2 = '2.2.2.2'
node2_long = '2.2.2.2:2003:0'
output2 = ['metric.100',
'metric.104',
'metric.106',
'metric.109']
f = list(carbonate.sieve.filterMetrics(inputs, node, self.cluster))
self.assertEqual(f, output)
f = list(carbonate.sieve.filterMetrics(inputs, node_long, self.cluster))
self.assertEqual(f, output)
f = list(carbonate.sieve.filterMetrics(inputs, node2, self.cluster))
self.assertEqual(f, output2)
f = list(carbonate.sieve.filterMetrics(inputs, node2_long, self.cluster))
self.assertEqual(f, output2)
f = list(carbonate.sieve.filterMetrics(inputs, node, self.cluster, True))
self.assertEqual(f, output2)
f = list(carbonate.sieve.filterMetrics(inputs, node2, self.cluster, True))
self.assertEqual(f, output)
'metric.102',
'metric.103',
'metric.105',
'metric.107',
'metric.108']
node2 = '2.2.2.2'
node2_long = '2.2.2.2:2003:0'
output2 = ['metric.100',
'metric.104',
'metric.106',
'metric.109']
f = list(carbonate.sieve.filterMetrics(inputs, node, self.cluster))
self.assertEqual(f, output)
f = list(carbonate.sieve.filterMetrics(inputs, node_long, self.cluster))
self.assertEqual(f, output)
f = list(carbonate.sieve.filterMetrics(inputs, node2, self.cluster))
self.assertEqual(f, output2)
f = list(carbonate.sieve.filterMetrics(inputs, node2_long, self.cluster))
self.assertEqual(f, output2)
f = list(carbonate.sieve.filterMetrics(inputs, node, self.cluster, True))
self.assertEqual(f, output2)
f = list(carbonate.sieve.filterMetrics(inputs, node2, self.cluster, True))
self.assertEqual(f, output)
'metric.107',
'metric.108']
node2 = '2.2.2.2'
node2_long = '2.2.2.2:2003:0'
output2 = ['metric.100',
'metric.104',
'metric.106',
'metric.109']
f = list(carbonate.sieve.filterMetrics(inputs, node, self.cluster))
self.assertEqual(f, output)
f = list(carbonate.sieve.filterMetrics(inputs, node_long, self.cluster))
self.assertEqual(f, output)
f = list(carbonate.sieve.filterMetrics(inputs, node2, self.cluster))
self.assertEqual(f, output2)
f = list(carbonate.sieve.filterMetrics(inputs, node2_long, self.cluster))
self.assertEqual(f, output2)
f = list(carbonate.sieve.filterMetrics(inputs, node, self.cluster, True))
self.assertEqual(f, output2)
f = list(carbonate.sieve.filterMetrics(inputs, node2, self.cluster, True))
self.assertEqual(f, output)
output2 = ['metric.100',
'metric.104',
'metric.106',
'metric.109']
f = list(carbonate.sieve.filterMetrics(inputs, node, self.cluster))
self.assertEqual(f, output)
f = list(carbonate.sieve.filterMetrics(inputs, node_long, self.cluster))
self.assertEqual(f, output)
f = list(carbonate.sieve.filterMetrics(inputs, node2, self.cluster))
self.assertEqual(f, output2)
f = list(carbonate.sieve.filterMetrics(inputs, node2_long, self.cluster))
self.assertEqual(f, output2)
f = list(carbonate.sieve.filterMetrics(inputs, node, self.cluster, True))
self.assertEqual(f, output2)
f = list(carbonate.sieve.filterMetrics(inputs, node2, self.cluster, True))
self.assertEqual(f, output)
match_dests = [args.node]
else:
match_dests = local_addresses()
try:
for metric in fileinput.input(fi):
if args.field is None:
m = metric.strip()
else:
fields = metric.split(args.field_separator)
try:
m = fields[int(args.field)-1].strip()
except IndexError:
raise SystemExit("Field index is out-of-bounds")
for match in filterMetrics([m], match_dests, cluster, invert):
print metric.strip()
except KeyboardInterrupt:
sys.exit(1)
match_dests = [args.node]
else:
match_dests = local_addresses()
try:
for metric in fileinput.input(fi):
if args.field is None:
m = metric.strip()
else:
fields = metric.split(args.field_separator)
try:
m = fields[int(args.field)-1].strip()
except IndexError:
raise SystemExit("Field index is out-of-bounds")
for match in filterMetrics([m], match_dests, cluster, invert):
print metric.strip()
except KeyboardInterrupt:
sys.exit(1)