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: