Leverage the new cliff command class attribute (_description)
to get the help of a command, this allows us to mark strings
for translation. We could not do this before since the help
was grabbed from the docstring.
This also depends on a new release of cliff and a bump to the
minimum level in osc's requirements.
Closes-Bug: 1636209
Depends-On: Id915f6aa7d95a0ff3dc6e2ceaac5decb3f3bf0da
Change-Id: I8673080bb5625e8e3c499feaefd42dfc7121e96f
When output to shell, the token issue time is fine; however when
selecting the json formatter (via the --format json) option, an
exception is raised when formatting the dataetime data.
Rather than pass in the datetime data, we should format the data
with the ISO 8601 formatting.
Closes-Bug: 1619937
Change-Id: Iffebb2d5413fabfd283dfa94fc560fc37270f9dd
The current identity role list command (both v2 and v3) is
overloaded with listing roles as well as assignments (if you
provide user, group, project or domain options). This is in
addition to the v3 assignment list command designed for this
purpose.
This overloading complicates the fact that roles can now be
domain specific (i.e. have a domain attribute), so the
command 'role list --domain <domain-name' will soon become
ambigious (this is in a follow on patch).
This patch:
- Adds a v2 assignments list, with support for pulling the
user and project from the auth credentials
- For comapability, adds the same auth support to the
existing v3 assignments list
- Deprecates the use of role list and user role list to list
assignments
Change-Id: I65bafdef4f8c89e863dab101369d0d629fa818b8
Partial-Bug: 1605774
Usually we use "(s)" to show about multi deletion in
help message. In addition, I think "EC2 credentials"
is better than "EC2 keys" in the error message.
Change-Id: I6a6461291542701d87a55d9ea0ea1fda6db04601
When an exception was caught and rethrown,
it should call 'raise' without any arguments
because it shows the place where an exception
occured initially instead of place where the exception re-raised.
Change-Id: I5fb6dea5da7fb6e1e2b339a713c7d37f8c99e407
Commands are "ec2 credentials delete", "service delete", "endpoint delete".
Also update their unit tests and functional tests.
Partial-Bug: #1592906
Change-Id: I1a0b7160b803a523646d09d030e6f112c81c4c24
Use file logger for all command specific logs.
This patch also fixes some usage that doesn't
follow rules in:
http://docs.openstack.org/developer/oslo.i18n/guidelines.html
After this patch, all self.log and self.app.log
will be standardized to LOG().
NOTE: In shell.py, we got the log in class OpenStackShell,
which is also known as self.app.log in other classes.
This logger is used to record non-command-specific logs.
So we leave it as-is.
Change-Id: I114f73ee6c7e84593d71e724bc1ad00d343c1896
Implements: blueprint log-usage
Migrate 'change', 'update' to 'modify',
migrate 'user to delete' to 'user(s) to delete',
migrate '(name or ID)' to '(type, name or ID)'.
Change-Id: Ie425e178bb5ddf773e6e793fcd91c78e9c4a5053
<service> argument of `endpoint create` command doesn't mean
`new endpoint service`, but an existent service that the new endpoint attached to.
Change-Id: I846fdb501bdea14499f42288186f375a3b2b5951
Use osc-lib directly for exceptions.
Leave openstackclient.common.exceptions for deprecation period.
Change-Id: Iea3e862302372e1b31ccd27f69db59b4953ca828
Currently OpenStackClient uses keystoneclient for authentication.
This change will update OpenStackClient to use keystoneauth for
authentication.
All dependant test have been updated.
Updating how auth_ref is set in the tests to use KSA fixtures had
some racy side-effects. The user_role_list tests failed when they
picked up an auth_ref that was a fixture. This exposed a weakness
in ListUserRole that needed to be fixed at the same time re
handling of unscoped tokens and options.
Change-Id: I4ddb2dbbb3bf2ab37494468eaf65cef9213a6e00
Closes-Bug: 1533369
If no region is set in Keystone, null is deserialized as None and the
region has None has value, which triggers a type error when building the
output string.
This patch fixes that.
Change-Id: I7637dc2595655cf452f38308f99fe66ac782e16d
Make scope check optional for the "token issue" command as unscoped token is
a valid Keystone V2/V3 API.
Change-Id: Ie1cded4dbfdafd3a78c0ebdf89e3f66762509930
Closes-Bug: #1543214
Previously each command logs take_action parameters explicitly
by using @utils.log_method decorator or log.debug().
Some commands have no logging.
This commit calls a logger in the base class and
drops all logging definition from individual commands.
Closes-Bug: #1532294
Change-Id: I43cd0290a4353c68c075bade9571c940733da1be
This patch introduces a unit test class TestProjectUnset
for testing unset cmd.
Co-Authored-By: Steve Martinelli <stevemar@ca.ibm.com>
Change-Id: Ib4a414d2313e3d37e48d1cb3639f064231aec508
Closes-Bug: #1486597
* Change session imports to keystoneauth1
* Change keystoneclient.exception imports to keystoneauth1
* Change exceptions raised from internal API from keystoneclient to openstack.common
Change-Id: I046d89f561d6fe04baae53726f9749d2e7fe2056
Instead of duplicating the same log statement throughout
the code, the same logic can be provided by a shared decorator
that abstracts away the logging capability and unifies it behind
a common function instead.
Change-Id: Icc63bced7347c8bbf0299a4c5821425a10892a79
With this change 'openstack catalog list' returns the correspoding URL for
publicURL, internalURL and adminURL in _format_endpoints .
Change-Id: I5d946c9d70a2d3c22a7cc77067fec8e2e9aa4940
Closes-Bug: 1472629
Re-sync the text in v2 and v3 help and the docs
Depends-On: If4ac5356ade8cff347bb9eb9f88d1ace82bb7275
Change-Id: Iabef2f271fcf46748295c29713fea1811dcab29c
Some service catalogs in the wild have services without region names defined.
Let's be nice and stuff in a default value indicating this state.
Closes-Bug: #1429211
Change-Id: I3ebe2534dc6e3438aaeddc7757fb2db4117eae4b
Changes to the 'service list' commands for Identity v2 and v3:
* Document support for --long
* Add Description to v3 output with --long
* v3 output is now (ID, Name, Type), with (Description, Enabled) added with --long
* Change v2 output to match v3 output, with the absense of Enabled.
* Update doc to match
Closes-Bug: #1411337
Change-Id: I999e3df22f61350cdeba63bbb7d01145c2ffeeaf
Looks like providing a service id isn't working, so it the help
message was reduced to just type and name.
Added a bit more to the docs, too.
Change-Id: Id7f8b48bdf99773ad55ca7f204f3c779f84633d5
try and add some consistency with the show and delete commands.
replace 'show x' with 'display x'
change 'delete a y' with just 'delete y'
Change-Id: I47dfa8ee23ac5c41b355796415eb515155832f65
I think there are three issues we should fix:
1. wrong indentation of 'continue'
2. currently, name is optional for service, but according to the
currrent logic, if a service doesn't have name attribute we will
select it anyway
3. we always loop all catalogs
Change-Id: I9fce66677affa396b6a12afea76e87cab9215a58
`os user role list` does the same as v3's `os role list`.
We should rework v2's `role list` to basically call `os user role list`
under the covers.
Closes-Bug: #1409179
Change-Id: I9839f6be139d6a6a3f6bbf79957e218dd8e03fe3