diff --git a/bin/filler.py b/bin/filler.py index 8f33455..1b51e0b 100755 --- a/bin/filler.py +++ b/bin/filler.py @@ -1,14 +1,16 @@ #!/usr/bin/env python # -*- encoding: utf-8 -*- -import pickle import argparse +import os +import pickle import sys import eventlet from keystoneclient.v2_0 import client as ksclient sys.path.append("../") +sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))) from common.utils import get_config from sync.filler import (load_index, load_containers_index, create_swift_account, fill_swift, @@ -44,10 +46,14 @@ def main(): pile = eventlet.GreenPile(concurrency) pool = eventlet.GreenPool(concurrency) - client = ksclient.Client(username=get_config('filler', 'a_username'), - password=get_config('filler', 'a_password'), - auth_url=get_config('filler', 'auth_url'), - tenant_name=get_config('filler', 'a_tenant')) + _config = get_config('auth', + 'keystone_origin_admin_credentials').split(':') + tenant_name, username, password = _config + client = ksclient.Client( + auth_url=get_config('auth', 'keystone_origin'), + username=username, + password=password, + tenant_name=tenant_name) if not args.create and not args.delete: parser.print_help() diff --git a/etc/config-sample.ini b/etc/config-sample.ini index bed5f86..287d8de 100644 --- a/etc/config-sample.ini +++ b/etc/config-sample.ini @@ -1,15 +1,12 @@ [auth] keystone_origin = http://vm:5000/v2.0 -keystone_origin_credentials = demo:demo:ADMIN +keystone_origin_admin_credentials = admin:admin:ADMIN + keystone_dest = http://vm2:5000/v2.0 +keystone_origin_demo_credentials = demo:demo:ADMIN keystone_dest_credentials = demo:demo:ADMIN - [filler] -a_username = admin -a_password = ADMIN -auth_url = http://vm:5000/v2.0 -a_tenant = admin swift_operator_role = Member concurrency = 1 diff --git a/sync/filler.py b/sync/filler.py index 7434cac..a1051ee 100644 --- a/sync/filler.py +++ b/sync/filler.py @@ -148,7 +148,7 @@ def delete_account(client, user_id, acc): def swift_cnx(acc, user): - cnx = sclient.Connection(get_config('filler', 'auth_url'), + cnx = sclient.Connection(get_config('auth', 'keystone_origin'), user=user, key=get_config('filler', 'default_user_password'), tenant_name=acc[0],