Merge "Use one ConfigOpts in placement-status"

This commit is contained in:
Zuul 2019-02-20 06:16:21 +00:00 committed by Gerrit Code Review
commit 31a83b21b4
3 changed files with 12 additions and 8 deletions

View File

@ -56,7 +56,7 @@ oslo.middleware==3.31.0
oslo.policy==1.35.0
oslo.serialization==2.18.0
oslo.service==1.24.0
oslo.upgradecheck==0.1.1
oslo.upgradecheck==0.2.0
oslo.utils==3.37.0
oslo.versionedobjects==1.31.2
oslotest==3.4.0

View File

@ -120,13 +120,17 @@ def main():
# Set up the configuration to configure the database.
config = cfg.ConfigOpts()
conf.register_opts(config)
config(args=[], project='placement')
# Register cli opts before parsing args.
upgradecheck.register_cli_options(config, Checks(config))
# A slice of sys.argv is provided to pass the command line
# arguments for processing, without the name of the calling
# script ('placement-status'). If we were using
# upgradecheck.main() directly, it would do it for us, but
# we do not because of the need to configure the database
# first.
config(args=sys.argv[1:], project='placement')
db_api.configure(config)
# NOTE(tetsuro): To parse the CLI commands, we pass a fresh ConfigOpts
# to oslo.upgradecheck. We don't use the same config above since it is
# already set up.
return upgradecheck.main(
cfg.ConfigOpts(), project='placement', upgrade_command=Checks(config))
return upgradecheck.run(config)
if __name__ == '__main__':

View File

@ -21,7 +21,7 @@ oslo.db>=4.40.0 # Apache-2.0
oslo.policy>=1.35.0 # Apache-2.0
oslo.i18n>=3.15.3 # Apache-2.0
oslo.middleware>=3.31.0 # Apache-2.0
oslo.upgradecheck>=0.1.1 # Apache-2.0
oslo.upgradecheck>=0.2.0 # Apache-2.0
oslo.versionedobjects>=1.31.2 # Apache-2.0
os-resource-classes>=0.2.0 # Apache-2.0
os-traits>=0.4.0 # Apache-2.0