From 1f91f7acba39a70bcef67dfadbfe4eb3b490d76b Mon Sep 17 00:00:00 2001 From: wangxiyuan Date: Fri, 20 Jul 2018 16:32:09 +0800 Subject: [PATCH] Add keystoneauth options to list_opts The [service_user] group contains keystoneauth's session options as well. This patch add these options back to list_opts. Change-Id: I5a890c37b1bc23befb1f5792aa6129ca0c250917 --- cinder/opts.py | 3 +++ tools/config/generate_cinder_opts.py | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/cinder/opts.py b/cinder/opts.py index eda55de604d..3671e517b81 100644 --- a/cinder/opts.py +++ b/cinder/opts.py @@ -23,6 +23,8 @@ import itertools +from keystoneauth1 import loading + from cinder import objects objects.register_all() @@ -276,6 +278,7 @@ def list_opts(): ('service_user', itertools.chain( cinder_serviceauth.service_user_opts, + loading.get_session_conf_options(), )), ('backend_defaults', itertools.chain( diff --git a/tools/config/generate_cinder_opts.py b/tools/config/generate_cinder_opts.py index dc56672f11f..b64291bdf8c 100644 --- a/tools/config/generate_cinder_opts.py +++ b/tools/config/generate_cinder_opts.py @@ -64,6 +64,7 @@ if __name__ == "__main__": opt_file.write("import itertools\n\n") + opt_file.write("from keystoneauth1 import loading\n\n") # NOTE(geguileo): We need to register all OVOs before importing any other # cinder files, otherwise any decorator that uses cinder.objects.YYY will # fail with exception AttributeError: 'module' object has no attribute @@ -166,6 +167,9 @@ if __name__ == "__main__": opt_file.write(" " + opt_line[2]) else: opt_file.write(opt_line[0]) + if opts.endswith('service_user_opts'): + opt_file.write( + " loading.get_session_conf_options(),\n") def _retrieve_name(aline): if REGISTER_OPT_STR in aline: