Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_list(self):
res = list(listMetrics(self.rootdir))
self.assertEqual(res, self.expected_metrics)
def test_list_with_trailing_slash(self):
res = list(listMetrics(self.rootdir + '/'))
self.assertEqual(res, self.expected_metrics)
def carbon_list():
parser = common_parser('List the metrics this carbon node contains')
parser.add_argument(
'-d', '--storage-dir',
default='/opt/graphite/storage/whisper',
help='Storage dir')
args = parser.parse_args()
try:
for m in listMetrics(args.storage_dir):
print m
except IOError as e:
if e.errno == errno.EPIPE:
pass # we got killed, lol
else:
raise SystemExit(e)
except KeyboardInterrupt:
sys.exit(1)
def carbon_list():
parser = common_parser('List the metrics this carbon node contains')
parser.add_argument(
'-d', '--storage-dir',
default='/opt/graphite/storage/whisper',
help='Storage dir')
args = parser.parse_args()
try:
for m in listMetrics(args.storage_dir):
print m
except IOError as e:
if e.errno == errno.EPIPE:
pass # we got killed, lol
else:
raise SystemExit(e)
except KeyboardInterrupt:
sys.exit(1)