From db04f196bdcefac0601ff0841e970e810df6a05d Mon Sep 17 00:00:00 2001 From: Ladislav Smola Date: Mon, 28 Jul 2014 08:12:01 +0000 Subject: [PATCH] Fix make_test_data tools script Method get_connection has been renamed to get_connection_from_config. Resource is object not dictionary, so attributes needs to be accessed that way. Change-Id: I19e09f3e9077d3346b4361fa6975a3e696e2e765 Related-Bug: #1349791 --- tools/make_test_data.py | 8 ++++---- tools/show_data.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/make_test_data.py b/tools/make_test_data.py index 4d2f3d81..e163eb12 100755 --- a/tools/make_test_data.py +++ b/tools/make_test_data.py @@ -100,14 +100,14 @@ def main(): root_logger.setLevel(logging.DEBUG) # Connect to the metering database - conn = storage.get_connection(cfg.CONF) + conn = storage.get_connection_from_config(cfg.CONF) # Find the user and/or project for a real resource if not (args.user or args.project): for r in conn.get_resources(): - if r['resource_id'] == args.resource: - args.user = r['user_id'] - args.project = r['project_id'] + if r.resource_id == args.resource: + args.user = r.user_id + args.project = r.project_id break # Compute start and end timestamps for the diff --git a/tools/show_data.py b/tools/show_data.py index 06142593..ceca3707 100755 --- a/tools/show_data.py +++ b/tools/show_data.py @@ -117,7 +117,7 @@ def main(argv): #ceilometer collector by default. default_config_files=['/etc/ceilometer/ceilometer.conf'], ) - db = storage.get_connection(cfg.CONF) + db = storage.get_connection_from_config(cfg.CONF) command = extra_args[0] if extra_args else 'help' COMMANDS[command](db, extra_args[1:])