121 Commits

Author SHA1 Message Date
Steve Martinelli
0ef8535036 translate all command help strings
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
2016-11-17 02:33:42 +00:00
qtang
3770ad08b2 Warning for empty password set for user create/set
Raise warning when empty password set for user

Change-Id: If03516f3f1290e4c329fe3d1277dee0512de0410
Closes-Bug: #1607959
2016-10-19 03:07:54 +00:00
Steve Martinelli
24c8b94baf format token expires time to prevent json loading datetime data
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
2016-09-05 17:23:42 +00:00
Dean Troyer
cc3d46a47b Fix up last-minute imports to use osc-lib
Change-Id: I1ed2983cf574ebd565eeac4f8199fbc3a2e29c8e
2016-08-18 18:22:42 +00:00
Henry Nash
713d92df4e Add assignment list to v2 identity and deprecate alternate listing
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
2016-07-22 21:46:29 +00:00
SongmingYan
1b878b4efd Remove execute permission on a few files
Some files have execute permission unnecessarily. Change them from
755 to 644.

Change-Id: I471ebd1c3d123ad4a7376f7f5996f53f8c2d9b0b
2016-07-22 17:38:34 +00:00
Huanxuan Ao
536c0d9dea Modify some help and error messages in ec2creds identityv2
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
2016-07-12 15:55:33 +08:00
qinchunhua
6f36385cb8 Correct reraising of exception
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
2016-07-07 15:05:58 +00:00
sunyajing
6df09fd377 Support multi-delete for commands in identity V2
Commands are "ec2 credentials delete", "service delete", "endpoint delete".
Also update their unit tests and functional tests.

Partial-Bug: #1592906
Change-Id: I1a0b7160b803a523646d09d030e6f112c81c4c24
2016-06-23 23:57:49 -04:00
sunyajing
e8483c9022 Standardize logger usage of catalog in identity
Change-Id: I5307f949b3a350e41840a4a5c191ceacf1b3b291
Partially-Implements: blueprint log-usage
2016-06-23 08:22:51 +00:00
Jenkins
f5ae23ab86 Merge "Standardize logger usage" 2016-06-20 17:26:57 +00:00
Tang Chen
047cb68493 Standardize logger usage
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
2016-06-20 15:16:51 +00:00
sunyajing
6dbe911800 Modify help msg and docs in identity
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
2016-06-17 09:41:39 +00:00
Jenkins
1464c8a237 Merge "Make set/unset command in identity and image pass normally when nothing specified" 2016-06-17 06:24:35 +00:00
sunyajing
8a12a39ece Make set/unset command in identity and image pass normally when nothing specified
Also update its unit tests.

Change-Id: I82b90658b0d4247cdc9a650f14aceda640a32059
Partial-bug: #1588588
2016-06-17 04:20:28 +00:00
Jenkins
b5e524ac84 Merge "Fix help msg of identity endpoint" 2016-06-16 12:43:32 +00:00
sunyajing
9eb77ae1de Fix help msg of identity endpoint
<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
2016-06-16 09:55:10 +08:00
Dean Troyer
9e2b8e6730 osc-lib: command
Leave command.py and test_command.py as a sanity check during the
deprecation period.

Change-Id: I24e1b755cbfbcbcaeb5273ec0c9706b82384fc85
2016-06-13 11:00:22 -05:00
Dean Troyer
be192676bd osc-lib: parseractions
Leave parseractions.py and test_parseractions.py as a sanity check during the
deprecation period.

Change-Id: I1a7469b6d872284e0276502a1a287bc0b87f8f83
2016-06-13 10:55:44 -05:00
Dean Troyer
e5e29a8fef osc-lib: utils
Use osc-lib directly for utils.

Leave openstackclient.common.utils for deprecation period.

Change-Id: I5bd9579abc4e07f45219ccd0565626e6667472f7
2016-06-13 10:50:44 -05:00
Dean Troyer
d20c863ebc osc-lib: exceptions
Use osc-lib directly for exceptions.

Leave openstackclient.common.exceptions for deprecation period.

Change-Id: Iea3e862302372e1b31ccd27f69db59b4953ca828
2016-06-13 10:50:01 -05:00
Navid Pustchi
6ae0d2e8a5 Moving authentication from keystoneclient to keystoneauth
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
2016-06-09 18:00:40 +02:00
Tang Chen
5293bb103e Fix i18n support problems in identity
Change-Id: I3b48d17850343051239b5b69e8b890dba32d3ac8
Partial-bug: #1574965
2016-06-07 09:37:02 +08:00
Jenkins
9da02d14ea Merge "fix endpoint show help" 2016-05-26 22:10:23 +00:00
sunyajing
9e9e4e6f59 fix endpoint show help
endpoint show command can also work on service name or type or ID option

Change-Id: I43c8df4bc093d4130cf33fd2520736ce9077dc82
2016-05-26 19:40:26 +08:00
Julien Danjou
e44bb009d3 keystone: fix catalog output when region is unset
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
2016-05-25 16:13:48 +02:00
Steve Martinelli
ebcbd6ba71 remove #noqa from i18n imports
hacking checks no longer fail on `import _`

Change-Id: Idd60f0a0e71e5081691eacb39e5091ab08fcce6d
2016-05-13 13:14:02 -07:00
Tang Chen
fc24f37ae2 Trivial: Remove useless return
If a function returns nothing, do not add return in the end.

Change-Id: I298b8717462f68d3076a1619d674775be2a94c42
2016-03-07 17:54:06 +08:00
guang-yee
41e1bd0be6 Support unscoped token request
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
2016-02-19 16:07:13 -08:00
Akihiro Motoki
258c1102cc log take_action parameters in a single place
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
2016-02-02 09:58:32 +09:00
Jude Job
a2a63f19bf Implementation for project unset cmd for python-openstackclient.
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
2016-01-04 10:25:55 -05:00
Dean Troyer
bf090c69c2 Switch to ksa Session
* 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
2015-12-02 01:55:14 +00:00
Joshua Harlow
e3c46ece4a Use a common decorator to log 'take_action' activation
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
2015-09-01 16:49:54 -07:00
Guojian Shao
7829aca704 only return endpoints that have url
Change-Id: I97a502252c0c377fce573e92b83c0122812f6f80
Closes-Bug: #1474656
2015-07-16 07:25:51 +00:00
Martin Schuppert
7af00f833f openstack catalog list always returns publicURL for internalURL and adminURL
With this change 'openstack catalog list' returns the correspoding URL for
publicURL, internalURL and adminURL in _format_endpoints .

Change-Id: I5d946c9d70a2d3c22a7cc77067fec8e2e9aa4940
Closes-Bug: 1472629
2015-07-08 21:40:44 +02:00
Dean Troyer
3fa0bbc7ee Clean up ec2 credentials help text
Re-sync the text in v2 and v3 help and the docs

Depends-On: If4ac5356ade8cff347bb9eb9f88d1ace82bb7275
Change-Id: Iabef2f271fcf46748295c29713fea1811dcab29c
2015-06-03 15:03:57 -05:00
Dean Troyer
ee2ba48aa4 Fix catalog list when region name is absent
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
2015-03-06 11:28:11 -06:00
TerryHowe
d05b5e14f1 Fix identity v2 catalog list
The v2 catalog list was only printing the last endpoint in
the catalog.

Change-Id: I5401a11eedb3be1513c86261329de50c8ad82720
2015-03-04 10:14:40 -07:00
Dean Troyer
c2c3f2e0f2 Update service clist commands for v2 and v3
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
2015-01-16 12:59:14 -06:00
Jenkins
4a8a2fb27d Merge "Rework role list v2 for --user and --project" 2015-01-13 22:35:21 +00:00
Jenkins
872e509ca5 Merge "Tweaks to the catalog doc and show command" 2015-01-13 07:45:15 +00:00
Jenkins
2525ec4e52 Merge "Fine tune some of the helps commands" 2015-01-13 07:41:47 +00:00
Steve Martinelli
c04b49ef07 Tweaks to the catalog doc and show command
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
2015-01-13 05:59:38 +00:00
Steve Martinelli
019c155e9b Fine tune some of the helps commands
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
2015-01-13 00:58:57 -05:00
Jenkins
a7a1a576e0 Merge "fix some small issues in catalog show" 2015-01-12 18:14:44 +00:00
Dean Troyer
6ebbd278cf Command docs: add service
Co-Authored-By: Lin Hua Cheng <os.lcheng@gmail.com>

Change-Id: Icd39e6d769fd4c4797fcf4ef9eb97c71ed166b3b
Closes-Bug: #1404434
2015-01-12 05:22:52 +00:00
wanghong
a8f60a8aa1 fix some small issues in catalog show
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
2015-01-12 12:08:43 +08:00
Steve Martinelli
ffb7832159 Rework role list v2 for --user and --project
`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
2015-01-10 01:02:33 +00:00
Jenkins
32c15633f4 Merge "Add endpoint v3 docs" 2015-01-04 05:07:50 +00:00
Jenkins
6698f14fdb Merge "type should be required for v2.0 service create" 2015-01-03 00:47:25 +00:00