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 test_list_with_trailing_slash(self): res = sorted(list(listMetrics(self.rootdir + '/'))) self.assertEqual(res, self.expected_metrics)
def test_list(self): res = sorted(list(listMetrics(self.rootdir))) self.assertEqual(res, self.expected_metrics)
def test_list_withsym(self): res = sorted(list(listMetrics(self.rootdir, True))) self.assertEqual(res, self.expected_metrics_withsym)
def test_list_with_trailing_slash(self): res = sorted(list(listMetrics(self.rootdir + "/"))) self.assertEqual(res, self.expected_metrics)