From b3335b3474e559d8afb0b7f86796fbb68a0687a8 Mon Sep 17 00:00:00 2001 From: TerryHowe Date: Fri, 8 May 2015 13:14:15 -0600 Subject: Do not set default versions in parsed args Setting default versions in parsed args makes it so OCC cannot tell if the argument was parsed, an environment variable was set or it is just defaulted. In order to set api versions from OCC, it will have to be defaulted after processing OCC. Closes-Bug: #1453229 Change-Id: I4d065919397b783f3bdd4022c986c0234a7a16e6 --- doc/source/backwards-incompatible.rst | 15 +++++++++++++++ doc/source/plugins.rst | 7 ++----- 2 files changed, 17 insertions(+), 5 deletions(-) (limited to 'doc/source') diff --git a/doc/source/backwards-incompatible.rst b/doc/source/backwards-incompatible.rst index c511852f..e89cc3a6 100644 --- a/doc/source/backwards-incompatible.rst +++ b/doc/source/backwards-incompatible.rst @@ -75,6 +75,21 @@ List of Backwards Incompatible Changes * Bug: https://bugs.launchpad.net/python-openstackclient/+bug/472613 * Commit: https://review.openstack.org/#/c/194654/ +6. Plugin interface change for default API versions + + Previously, the default version was set in the parsed arguments, + but this makes it impossible to tell what has been passed in at the + command line, set in an environment variable or is just the default. + Now, the module should have a DEFAULT_API_VERSION that contains the + value and it will be set after command line argument, environment + and OCC file processing. + + * In favor of: DEFAULT_API_VERSION + * As of: 1.2.1 + * Removed in: NA + * Bug: https://bugs.launchpad.net/python-openstackclient/+bug/1453229 + * Commit: https://review.openstack.org/#/c/181514/ + For Developers ============== diff --git a/doc/source/plugins.rst b/doc/source/plugins.rst index d603e102..17a508fe 100644 --- a/doc/source/plugins.rst +++ b/doc/source/plugins.rst @@ -83,7 +83,7 @@ so the version should not contain the leading 'v' character. .. code-block:: python - DEFAULT_OSCPLUGIN_API_VERSION = '1' + DEFAULT_API_VERSION = '1' # Required by the OSC plugin interface API_NAME = 'oscplugin' @@ -123,10 +123,7 @@ so the version should not contain the leading 'v' character. parser.add_argument( '--os-oscplugin-api-version', metavar='', - default=utils.env( - 'OS_OSCPLUGIN_API_VERSION', - default=DEFAULT_OSCPLUGIN_API_VERSION), help='OSC Plugin API version, default=' + - DEFAULT_OSCPLUGIN_API_VERSION + + DEFAULT_API_VERSION + ' (Env: OS_OSCPLUGIN_API_VERSION)') return parser -- cgit v1.2.1