From a856d54c8df7bf3a0212b4c7fd8f18a6a6b91449 Mon Sep 17 00:00:00 2001 From: xuegao Date: Fri, 18 Dec 2020 10:37:23 +0100 Subject: Add basic auth header Add basic auth header for sdc-backend-init python scripts. Issue-ID: OJSI-273 Signed-off-by: xuegao Change-Id: I3559d5792509db0f65b202a731545083c7c91c96 Signed-off-by: xuegao --- catalog-be/src/main/resources/scripts/sdcBePy/users/run.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'catalog-be/src/main/resources/scripts/sdcBePy/users/run.py') diff --git a/catalog-be/src/main/resources/scripts/sdcBePy/users/run.py b/catalog-be/src/main/resources/scripts/sdcBePy/users/run.py index 1518c2f673..56640db4cf 100755 --- a/catalog-be/src/main/resources/scripts/sdcBePy/users/run.py +++ b/catalog-be/src/main/resources/scripts/sdcBePy/users/run.py @@ -19,8 +19,8 @@ def load_users(conf_path): return json.load(f) -def be_user_init(be_ip, be_port, protocol, conf_path): - sdc_be_proxy = SdcBeProxy(be_ip, be_port, protocol) +def be_user_init(be_ip, be_port, header, protocol, conf_path): + sdc_be_proxy = SdcBeProxy(be_ip, be_port, header, protocol) if check_backend(sdc_be_proxy, properties.retry_attempts): users = load_users(conf_path) for user in users: @@ -49,6 +49,7 @@ def get_args(): parser.add_argument('-i', '--ip', required=True) parser.add_argument('-p', '--port', required=True) + parser.add_argument('--header') parser.add_argument('--https', action='store_true') path = os.path.dirname(__file__) parser.add_argument('--conf', default=os.path.join(path, 'data', 'users.json')) @@ -56,7 +57,7 @@ def get_args(): args = parser.parse_args() init_properties(10, 10) - return [args.ip, args.port, 'https' if args.https else 'http', args.conf] + return [args.ip, args.port, args.header, 'https' if args.https else 'http', args.conf] def main(): -- cgit 1.2.3-korg