This breaks down initialize_app() into the components that an
application needs to be able to override to subclass objects:
OSC_Config, ClientManager
Change-Id: Icce81e69e94a1d96a5d9bf6358e7c2ae09be1a44
There is no feature/osc4 branch in openstack/requirements repository.
osc-lib itself has no dependency on a specific branch related to
feature/osc4, so this is no need for this kind of stuffs.
This change breaks tox jobs when running them in local env.
Note that the upstream gate succeeded because UPPER_CONSTRAINTS_FILE
envvar is specified in our gate job.
This reverts commit ef967cbeba.
Change-Id: I3acacbb1d4190a18f05838f1aea4c37254b50b10
cliff has a concept of FormattableColumn which allows CLI implementors
to convert data into human-readable format only when a human-readable
format is requested and keep data unconverted for manchine-readable
formats like JSON or YAML.
Deprecation warnings is now emitted in favor of using FormattableColumn.
Partially implement blueprint osc-formattable-columns
Change-Id: Ia55bc950ecfc666d4a957507beab98eef74390aa
Related-Bug: #1687955
When formattable columns are used we cannot compare two items
just using assertEqual(item1, item2). We need to compare
two items column by column calling human_readable or
machine_readable methods.
This commit add convenient assert methods to encourage
the usage of cliff formattable columns in OSC.
An example of the usage of the new methods is found at:
https://review.openstack.org/#/c/462170/ or related reviews.
Related-Bug: #1687955
Related to blueprint osc-formattable-columns
Change-Id: Ib801f6204e7a694c597d93a3a6d40dc500212f65
Set some of the new config values and enable openstackdocstheme as an
extension so it will inject values into the page context as it writes
each documentation page. This ensures the pages link to the right bug
tracker, etc.
Change-Id: Ifee9dcb2982313210fd66479b32e3c1203ce14de
Depends-On: Icf3a40ed104cfd828f532f6f2b112ed02f996ff5
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
Update a docstring that had an rst formatting error and then turn on the
warning-is-error flag to prevent future issues with documentation.
Change-Id: I29fc90a2eb1599c9da88489415a9e080d88cc707
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
utils.find_resource tries to query the resource in multiple ways:
first as ID, second as name but with parameters and so on.
If no extra parameters are given, the second query would be
the same as the first and thus is not needed.
Change-Id: I37fd4c8c75d354df95cd7f9ce2af092c9ac6962c
--os-profile argument can be loaded from OS_PROFILE environment variables
to avoid repeating --os-profile in openstack commands.
Change-Id: I8615a972e8a1e8a39e97c3d6e7f07add4b6ab599
NOTE(dtroyer):
This global option should have been named --os-profile as --profile
interferes with at least one existing command option.
Deprecate --profile and remove after Apr 2017.
Change-Id: Icac979e0828e0b7bccecb97c806db8fe766f4652
When this was brough over from OSC we did not save the OpenStackConfig
object created in shell.initialize_app(). Others have come to rely
on it being in shell.cloud_config so save it.
Change-Id: I1a82cd94febb1775bcd9fae05d5d5ed860c5baa7
The headers keyword arg was missed on api.find_bulk() resulting
in no results being returned as it was handled as a filter attribute.
Change-Id: I703a0231046587d9ed546561fbf5dd7fa313c443
Commands that do not reuire authentication still call things that want
to check the service catalog; no auth means no service catalog.
(I'm looking at you OSC's is_networking_enabled()) Get more aggressive
at not doing auth when it is not required.
The cost of this is commands with auth_required=False need to be more
selective about what they do with ClientManager.auth_ref as it will
now happily return None when auth is not required _and_ no credentials
are present, rather than throw up all over the place.
Change-Id: I72ae6154268bdf26be6054c0fef6a4c67c71119c
Duplicate the basic endpoint cleanup (removing trailing '/') into
a method that can be overridden in subclasses to do additional things
like API-specific version handling.
Add more tests for the combinations of endpoint and url and some
corner-case checking.
Change-Id: I4b4f2abdec29e4d29b61338077f9c1320cec5bb8
Add a ClientManager test for Token authentication (specifically
keystoneauth's admin_token) that got dropped in the move from
OSC because OSC uses its own token_endpoint plugin loader, but
creates the same AdminToken object.
This would have prevented the issues seen with the merging of
https://review.openstack.org/452711 that were subsequently reverted
in https://review.openstack.org/458586.
Change-Id: I516682057d759d4becd8f6675cf7fa262d224eb9