summaryrefslogtreecommitdiff
path: root/openstackclient/identity/v3/user.py
Commit message (Collapse)AuthorAgeFilesLines
* Fix 'domain' filter not work well in some commandsjiangpch2017-07-181-2/+4
| | | | | | | | | The 'domain' filter not work well in commands 'project show', 'user show' and 'user set'. Depends-On: I490900d6249f01654d4cba43bddd3e7af7928a84 Closes-Bug: #1704097 Change-Id: Ib4f47cbaba27eb56c4a41d187fee74a995e62dc7
* Adds domain specification for SetUserSamuel Pilla2017-01-251-4/+19
| | | | | | | | | | | This patch adds the ability to specify the domain context for making changes to a user with `--domain` flag. Example: $ openstack user set test_user --domain test_domain --enable Change-Id: I2b3241785c22e72e19181394acff650422299b0e Closes-Bug: #1658147
* Error handling for delete commands in identityHuanxuan Ao2017-01-031-8/+22
| | | | | | | | | Add missing multi deletion error handling for identity delete commands. All delete commands in identity support error handling now. Change-Id: I05626dcb5e516a423d610906347b02236ba7eeaf
* translate all command help strings3.4.0Steve Martinelli2016-11-171-6/+6
| | | | | | | | | | | | | | 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
* Warning for empty password set for user create/setqtang2016-10-191-0/+12
| | | | | | | Raise warning when empty password set for user Change-Id: If03516f3f1290e4c329fe3d1277dee0512de0410 Closes-Bug: #1607959
* Remove execute permission on a few filesSongmingYan2016-07-221-0/+0
| | | | | | | Some files have execute permission unnecessarily. Change them from 755 to 644. Change-Id: I471ebd1c3d123ad4a7376f7f5996f53f8c2d9b0b
* Make set/unset commands pass normally when nothing specified in identityv3Huanxuan Ao2016-07-141-13/+0
| | | | | Change-Id: I554b41969f96b62a2c6d37024caa56b1441d5ed1 Partial-bug: #1588588
* Correct reraising of exceptionqinchunhua2016-07-071-2/+2
| | | | | | | | | 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
* Use resource id when name given for identity showDavid Rosales2016-06-221-2/+4
| | | | | | | | | | | | | | | Currently a user is allowed to specify either a resource ID or name when running openstack identity comands. In some cases, when a name is specified instead of an ID, the command will return as not able to find the resource when it in fact does exist. The changes here are to check the client against the token on such requests and to extract the ID of the resource specified if enough information exists between the two. We then use the ID associated with the resource to complete the user requests. Change-Id: I40713b0ded42063b786dc21247e854224b9d2fe2 Closes-Bug: #1561599
* Merge "Standardize logger usage"Jenkins2016-06-201-1/+5
|\
| * Standardize logger usageTang Chen2016-06-201-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Modify help msg and docs in identitysunyajing2016-06-171-1/+1
|/ | | | | | | | 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
* osc-lib: commandDean Troyer2016-06-131-1/+1
| | | | | | | Leave command.py and test_command.py as a sanity check during the deprecation period. Change-Id: I24e1b755cbfbcbcaeb5273ec0c9706b82384fc85
* osc-lib: utilsDean Troyer2016-06-131-2/+2
| | | | | | | | Use osc-lib directly for utils. Leave openstackclient.common.utils for deprecation period. Change-Id: I5bd9579abc4e07f45219ccd0565626e6667472f7
* Fix i18n support problems in identityTang Chen2016-06-071-32/+31
| | | | | Change-Id: I3b48d17850343051239b5b69e8b890dba32d3ac8 Partial-bug: #1574965
* Do not require an scope when setting a passwordAlvaro Lopez Garcia2016-05-271-0/+2
| | | | | | | | Changing the password in Keystone V3 is an unscoped operation, but we were requiring a scope. Change-Id: If0653ac7b59320c2cd9d42a2c73dd29c3626d389 Closes-Bug: 1543222
* remove #noqa from i18n importsSteve Martinelli2016-05-131-1/+1
| | | | | | hacking checks no longer fail on `import _` Change-Id: Idd60f0a0e71e5081691eacb39e5091ab08fcce6d
* take_action() method from command.Command shouldn't returnMohan Muppidi2016-02-291-3/+4
| | | | | | | | | | | | command.Command and command.Showone are base classes implemented in cliff framework. Showone extends Command to allow take_action() to return data to be formatted using a user-selectable formatter. Most of the classes which are extended from Command in openstackclient/identity/v3/ in some cases return data or return nothing where it is not necessary, this commit fixes most of them. Change-Id: I84c72ea4d6680f8bdbef5449316dd9a8af8c8286 Closes-Bug: 1550892
* log take_action parameters in a single placeAkihiro Motoki2016-02-021-25/+4
| | | | | | | | | | | | 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
* Support non-interactive user password updateGuang Yee2016-01-111-2/+29
| | | | | | | | | | | | | | Currently user password update require interactive prompting of user's original password. This is problematic because we can't support non-interactive applications and therefore hinders automation. This patch make it possible by optionally accepting an '--original-password' argument. If specified, we would use it instead of prompting. DocImpact Change-Id: I2d994e8c2be949f7ae616ac1d1594fb94e1a27cd Closes-Bug: 1531360
* Switch to ksa SessionDean Troyer2015-12-021-2/+2
| | | | | | | | * 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
* Merge "Support listing users by group name"Jenkins2015-09-191-6/+4
|\
| * Support listing users by group nameSteve Martinelli2015-09-071-6/+4
| | | | | | | | | | | | | | | | | | | | | | Listing users within a group is not presently domain scoped. We do not use the domain info at all when the group option is present. A new --group-domain option is not needed since we cannot list users by --project and --group, they are mutually exclusive (as per the identity API). Closes-Bug: 1492916 Change-Id: I50f995ee4a03c2bdb21f2b5722546ab8fe786eb6
* | Use a common decorator to log 'take_action' activationJoshua Harlow2015-09-011-6/+6
|/ | | | | | | | | 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
* add --project-domain option for user v3Guojian Shao2015-07-161-6/+8
| | | | | | | | | user v3 create/set only support --project option, we need --project-domain to prevent collisions between project names exist. Change-Id: I2d62e5b9bb6df4c5c5a9542514faf2e4365bb18b Closes-Bug: #1475357
* Not use the deprecated argumentDave Chen2015-06-081-1/+1
| | | | | | | | | `project` argument is deprecated in keystoneclient for V3 API, and use `default_project` instead, should use `default_project` as the argument name in the openstackclient accordingly. Change-Id: Ib9d70801c933a184afcdab75204393efa764fa87 Closes-Bug: #1462389
* remove unnecessary conditionalsSteve Martinelli2015-04-191-6/+3
| | | | | | | | In several places we had else branches where a reasonable default would do the job. This makes the code a mean cleaer and easier to read. Change-Id: I231e09aab85fd32b8300bc33c48d0899b728b96e
* Restrict groups and users from changing domainsSteve Martinelli2015-02-091-9/+0
| | | | | | | | | | Similar to projects, we shouldn't allow users and groups to change domains. The server side tosses up an error but osc should restrict that behaviour in the first place. Related-Bug: #1418384 Change-Id: I860291a5859c576021b18e35d1a12c32abfb6ca5
* Fine tune some of the helps commandsSteve Martinelli2015-01-131-1/+1
| | | | | | | | | 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
* Allow user list to filter by projectSteve Martinelli2015-01-081-7/+46
| | | | | | | | Adds a --project filter to `os user list`, which really calls the role assignment manager behind the scenes. Change-Id: I57a75018f12ed3acdf8f6611b6b58bd974f91da2 Closes-Bug: #1397251
* Merge "Rename column to `default project id` for long listing v3 user"Jenkins2015-01-021-4/+9
|\
| * Rename column to `default project id` for long listing v3 userSteve Martinelli2015-01-021-4/+9
| | | | | | | | | | | | | | Previously this column was coming up as empty, since user's have a `default project id`, not just `project id`. Change-Id: I3d7f7eb600e9526b9c6cc2a8c5d6009b9100b1f5
* | add multi-delete support for identitywanghong2014-12-231-11/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This is part2. Add support for these objects: identity.project(v2.0) identity.role(v2.0) identity.user(v2.0) identity.project(v3) identity.role(v3) identity.user(v3) identity.group(v3) Closes-Bug: #1400597 Change-Id: I270434d657cf4ddc23c3aba2c704d6ef184b0dbc
* | Don't import form keystoneclient.openstack.commonJamie Lennox2014-12-171-1/+1
|/ | | | | | | | The keystoneclient.openstack.common directory is where we sync files from oslo incubator. It is not a public directory and should not be being consumed by openstackclient. Change-Id: I011bb95c2c824e2dbc4b822ca922ae77b8d9b955
* Add support for domains when deleting identity v3 resourcesSteve Martinelli2014-12-011-4/+13
| | | | | | | | | | Currently, only deleting via IDs is possible for groups, projects and users. We should have an optional --domain argument that allows for a name to be specified for the resource. (Since these are all namespaced by domains). Change-Id: I18ace3db85a3969f0b97678d432d6f8368baa9cd
* Command object docs: project, role, userDean Troyer2014-12-011-36/+36
| | | | | | | | | project role user user role Change-Id: I445e09a3ffb69114912ae562a9285963a636bfd1
* Add --or-show support for v3 identity resourcesSteve Martinelli2014-11-181-9/+25
| | | | | | | | | | | | Add --or-show for the following: * v3 roles * v3 projects * v3 domains * v3 users * v3 groups Closes-Bug: #1390389 Change-Id: Id4ef043e5fda6be49a515eb3fe138c813c393ec9
* Remove 'links' section from several v3 Identity objectsSteve Martinelli2014-10-111-3/+3
| | | | | | | | | | | | | | | The links field in the returned objects from the v3 Identity API aren't really useful, so let's remove them. Managed to remove most of them from the core API. I'll likely remove the extension/contribution (oauth/federation) related ones in another patch. Also in this patch the code for setting services and projects was changed. Though not incorrect, it was not needed to copy the entire returned object, we should just need to pass in the fields we want to update. Change-Id: I164ca9ad8b28fa10b291e9115ef40753e387c547
* Allow --domain to be used for identity commands without lookupNathan Kinder2014-10-091-10/+7
| | | | | | | | | | | | | | | | | Performing create, list, or set operations for users, groups, and projects with the --domain option attempts to look up the domain for name to ID conversion. In the case of an environment using Keystone domains, it is desired to allow a domain admin to perform these operations for objects in their domain without allowing them to list or show domains. The current behavior prevents the domain admin from performing these operations since they will be forbidden to perform the underlying list_domains operation. This patch makes the domain lookup error a soft failure, and falls back to using the passed in domain argument directly as a domain ID in the request that it sends to Keystone. Change-Id: I5139097f8cedc53693f6f71297518917ac72e50a Closes-Bug: #1378565
* Add domain parameters to user show for Identity V3Steve Martinelli2014-10-091-7/+15
| | | | | | | | | | | Update `user show` for Identity V3 to account for a domain argument, in doing so, also update `find resource` to be more flexible by allowing **kwargs. Also update `group show` and `project show` since they follow the same logic as a user within a group. Change-Id: Ib828e4dbeb0bd31164396069ce8a64c873179779 Closes-Bug: #1378165
* Pass in domain and project as positional args, not kwargsSteve Martinelli2014-10-021-2/+2
| | | | | | | | | | The signature for users.set in keystoneclient dictates that domain and project be sent in, not domainId and projectId, which are being incorrectly sent in as 'extra' data. Closes-Bug: #1376833 Change-Id: I44df3e492f61eab2241f3758dee622417bb6f399
* Add action 'user password set' for identiy v3Mouad Benchchaoui2014-09-071-0/+29
| | | | | | | | | | | This new action will allow a user to change their own password by either providing the new password as an argument (--password) or by being prompted to enter the new password. In both cases user will be prompted to enter their current password as required by the v3 API. Closes-Bug: #1337245 Change-Id: I5e1e0fd2b46a4502318da57f7cce2b236fb2d93d
* Complete Identity v3 list command filtersDean Troyer2014-06-191-12/+38
| | | | | | | Complete the 'group list' and 'user list' filter options following the refactor in https://review.openstack.org/69878 Change-Id: Ib4af417c56d4f7da4b88852f191af615cc7fa2ec
* Refactor role list subcommand for identity v3 apiQiu Yu2014-06-131-80/+7
| | | | | | | | | | | | | | | Currently parts of user list and group list command are actually functioning as role listing, which is quite counter intuitive and misleading. This refactor change move role related logic to a single place of role list command. It now allows role grants listing for user/group + domain/project combinations. If no user or group specified, it will list all roles in the system, which is the default behaviour. Change-Id: I4ced6df4b76f018d01000d28b4281ad9f252ffcc
* replace string format arguments with function parametersChristian Berendt2014-05-201-5/+5
| | | | | | | | There are files containing string format arguments inside logging messages. Using logging function parameters should be preferred. Change-Id: Ic749ac9eb55564ed631d57055a5a4dfc3aebd169
* Pass arguments to v3 keystoneclient by kwargJamie Lennox2014-04-041-1/+1
| | | | | | | | | Keystoneclient has added the positional decorator which emits a warning if arguments aren't passed by keyword. This means we are getting warnings in certain places in openstackclient. Change-Id: Ic5446cd6f122cbb56fce543011386d53bc31fe18 Closes-Bug: #1302199
* Merge "Fix some help strings"Jenkins2014-02-231-1/+1
|\
| * Fix some help stringsAndreas Jaeger2014-02-211-1/+1
| | | | | | | | | | | | | | | | | | | | This fixes some errors and inconsistencies I found reviewing the help strings: * Capitalize help strings * Add missing space between words (in multi-line strings) * Improve wording Change-Id: I2fb31ab4191c330146e31c1a9651115a6657769a
* | Add ability to prompt for passwords for user create and setTerry Howe2014-02-211-0/+17
|/ | | | | | | | | | * Add get_password method to the utilities * Add --password-prompt option * Call the get_password method if a prompt is requested * Various tests Change-Id: I1786ad531e2a2fbcc21b8bc86aac0ccd7985995a Closes-Bug: 1100116
* Identity v3 testsDean Troyer2013-09-091-32/+54
| | | | | | | | | * Add project, user, role and service v3 tests * Fix issues in commands with enable/disable * Make commands and tests more consistent between versions * Make formatting and comments more consistent Change-Id: Id21e7a5abd7e421a7742f937861ec46b53095fc7