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
This commit is contained in:
wangxiyuan 2018-07-20 16:32:09 +08:00 committed by wangxiyuan
parent 06a30ceffd
commit 1f91f7acba
2 changed files with 7 additions and 0 deletions

View File

@ -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(

View File

@ -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: