Include option '--human-readable' to 'image show' command.
This option displays image size in human readable format
(such as K, M, G, T,..)
(Re-submitted as the original https://review.openstack.org/#/c/399982/ had
a parent commit not present in Gerrit, was proposed by "OpenStack
Proposal Bot")
Change-Id: I0ef74c2ec978483fe49156c88acf5c369a8fa5c2
Closes-Bug: #1640086
Co-Authored-By: Badhmapriya Boopalan <Badhmapriya.Boopalan@cognizant.com>
Some object fields are allowed to be set to None, in such cases we
shouldn't call any formatters on the field.
For example, a subnet has a field 'service_types' which could be a list
of values but is also nullable.
Change-Id: I6574bdf742c0cd24cc824f08e8ba4c40d390cbe0
Closes-Bug: #1652025
OSC has some additions to OSC_Config that we need to include:
* Updates to initialize_app() and prepare_to_run_command()
Change-Id: I1846f823fb57bb0b43c0f074a24d3de1a8e4a24f
OSC has some additions to OSC_Config that we need to include:
* A fix for bug 1642301 in _auth_default_domain()
* The addition of _validate_auth_ksc() and _validate_auth() that
include current OSC needs. These need to be migrated into os-client-config
in a compatible manner...
Change-Id: I21a6ba3682ef97146db977270315c74c12d7b3b5
Allow users to direct calls using the OpenStackClient to a remote
federated service provider using Keystone 2 Keystone federation.
Change-Id: Icbdb286f840ecd3a57c64ef69b9e55925439b2f1
os-client-config is fixing the _validate_auth() issues, we don't
need to anymore. No back-compat is required, only OSC ever expected
this and that version was never released.
Change-Id: Ic0f2887a4aa18c313692850cf624101f9f7cdefb
Keystoneauth now supports passing app_name and app_version when creating
the session to build a sensible user agent string including client
versions. osc-lib and OpenStack Client should be amongst the first to
support this.
Change-Id: Ia46c1eea29678824a5934d846a08dbe52f5058d0
When config is coming from a clouds.yaml file, Python's yaml parser may
turn the version into an int if it is not quoted in the yaml. Ensure
that we set the value to a string before interacting with it.
Also fix a possible string action on a None object.
Change-Id: Ibf02a85d89c95ba76688b3f5c417f861173008d5
Closes-Bug: #1634986
The auth config hook can have credentials in it so
we have to mask the config before logging it. To
avoid doing the work of masking the password if we
aren't going to log it, there is a conditional put
around the actual debug statement.
Change-Id: I8e626672ec94fc837610216bccb4354dbdedca17
Closes-Bug: #1630822
Following OpenStack Style Guidelines[1]: http://docs.openstack.org/developer/hacking/#unit-tests-and-assertraises
[H203] Unit test assertions tend to give better messages for more
specific assertions. As a result, assertIsNone(...) is preferred
over assertEqual(None, ...) and assertIs(..., None)
Change-Id: If09f921565a2252f30fd77324c343272293c3a92
This is tolerant of os-client-config releases above 1.18.0 and will
start prompting for passwords when 1.21.0 or newer is present.
Once o-c-c 1.21.0 reaches the minimum in global requirements.txt
all of this hackery can go away.
Change-Id: I8054cc2372299592c4ecf9e7eb0e7971be51682b
The default for self.verify should be self._cli_options.verify,
this was missing. This also simplified setting the default for
self.cacert.
Closes-bug: #1616891
Change-Id: I53f0e18fe8fdd07c58c1b687146522ffba9e0044
In some part in the code we import objects.
In the Openstack style guidelines they recommend to import only modules.
http://docs.openstack.org/developer/hacking/#imports
Change-Id: I9c1ebe645b7dc8379f60e13ef6ea43bbe6ab1bcb
We needed a bit more to work around os-client-config 1.18.0's broken
precedence; this can't all be fixed in OSC.
Change-Id: Ibe1c36e72c96eb2b3746645f7e6b433307ce8021
os-client-config 1.19.1 contains a critical fix for OSC 3, however
other clients have problems that prevent that version from being used
so let's bring the critical fized here so we can move forward.
Change-Id: Id0af268ae397b66d0212a07b910ebd30ddc65878
user_domain_id or user_domain_name are only needed in some plugins
(namely v3password and v3totp). Adding defaults for them cause
failures in auth plugins that do not accept these keyword arguments.
Closes-bug: #1610911
Change-Id: Ic43b4a0d807697cd93e50b9f15c94471e2aea8f9
Decode default argv into Unicode on Python 2 (Python 3 does this
under the covers).
Backport of OSC change https://review.openstack.org/#/c/343035/
Co-Authored-By: John Dennis <jdennis@redhat.com>
Related-Bug: 1603494
Change-Id: I192f17962bb5e21c20c3743b8f3e88c2450432c7
null key is the invalid input when setting property
in the openstack components.
Prevent null key setting for property in
openstackclient.
Change-Id: I8ec72664b5393ffef71fffa4bd1cd3c303e86a52
Related-Bug: #1558690
osc_lib.utils.TestShell may be subclassed in other modules to test
osc_lib.shell.OpenStackShell subclasses. Set the shell class to be
tested by setting TestShell.shell_class_path to the full class path.
Change-Id: I0ab187d370ebb28760d90a8aca4b64eea19c8d9e
OSC_Config now handles all of the monkey-business we do with auth-related
arguments during the os-client-config portion of our program. ClientManager
is one more step closer to totally not caring about what the CLI options
look like.
Change-Id: Ifcf2d0c22901d37c790267dcf33d21c71556de47
In unittest2, assertDictEqual() is implemented by
using != operator to compare two dicts. So is
assertEqual() in testtools. assertEqual() in
testtools is able to handle dict, list, set and so
on. So we just call assertEqual() to make the unit
tests simpler.
Change-Id: I5eeeebced716f2065e81d72a9972392ae3a45d89
The translation of the auth arg handling workarounds from OSC missed
a detail in the differences between OSC's option Namespace and
os-client-config's config dict: the auth args are in a 'auth' sub-dict.
Also expanded some of the testing to catch more edge cases.
Closes-Bug: 1603479
Change-Id: I80bb42992a1a93857be4c6367405df645780a33d
When loading the auth plugin options, the conversion from "-" into "_"
is done based on the "dest" attribute of the option, instead of using
its name. This makes that if a plugin defines an option with a different
destination the wrong option will be created in osc, therefore the
option won't be passed properly to the plugin class.
Backported from OSC Iac7346dd57f8ea4f5b956b9bdf9f70d9494b63f8
(https://review.openstack.org/#/c/335003/)
Co-Authored-By: Alvaro Lopez Garcia <aloga@ifca.unican.es>
Closes-Bug: #1596937
Change-Id: Iab84c918f82d0313d2562ebc0655bf11d24175c9
This is the default in the keystoneauth session. There's no reason that
OSC needs to do it.
With this there is no additional reason for there to be a direct
requirement on requests.
Change-Id: Ia02c09e26a5a89002185e82baf16617103cf1cab
Best I can see this was copied across from OSC and are not used anywhere
in osc-lib. We can remove them.
Change-Id: Ie72eedc034c87e1e94a90465f0919074c9b27774