summaryrefslogtreecommitdiff
path: root/openstackclient/common
Commit message (Collapse)AuthorAgeFilesLines
* Merge "Enhance the theming for modules page"Jenkins2014-12-011-1/+1
|\
| * Enhance the theming for modules pageSteve Martinelli2014-11-181-1/+1
| | | | | | | | | | | | Also fixes a few small docstring syntax errors Change-Id: I85eb968e32c1191cf5d60d02deff2ab7f3291074
* | Begin copying wiki command list hereDean Troyer2014-11-192-7/+7
|/ | | | | | | | | | * Sort by command objects * Drop the comparison to the project CLIs * Minor updates to command help to match docs Initially include the cross-API commands to establish the structure and format. Change-Id: I77a7b3c89e088b66aa62941e29ce0b65b532285b
* Adjust some logging levelsDean Troyer2014-10-241-1/+1
| | | | | | | * Promote select messages to INFO so lower logging levels can be useful * Help more modules not say so much all the time Change-Id: I814023c1489595998ae74efe40ef439b3522ee74
* Change --os-auth-plugin to --os-auth-typeDean Troyer2014-10-231-9/+9
| | | | | | | | | | | | | | | | | | | | User's don't know what a plugin is. * Internally, os_auth_type and/or auth_type represents what the user supplied. * auth_plugin_name is the name of the selected plugin * auth_plugin is the actual plugin object Plugin selection process: * if --os-auth-type is supplied: * if it matches against an available plugin, done * (if it can map to an availble plugin type, done; TODO in a followup) * if --os-auth-type is not supplied: * if --os-url and --os-token are supplied, select 'token_endpoint' * if --os-username supplied, select identity_api_version + 'password' * if --os-token supplied, select identity_api_version + 'token' Change-Id: Ice4535214e311ebf924087cf77f6d84d76f5f3ee
* Clean up shell authenticationDean Troyer2014-10-211-7/+39
| | | | | | | | | | | | | | | | | | | | | * Remove the auth option checks as the auth plugins will validate their own options * Move the initialization of client_manager to the end of initialize_app() so it is always called. Note that no attempts to actually authenticate occur until the first use of one of the client attributes in client_manager. This leaves initialize_clientmanager() (formerly uathenticate_user()) empty so remove it. * Remove interact() as the client_manager has already been created And there is nothing left. * prepare_to_run_command() is reduced to trigger an authentication attempt for the best_effort auth commands, currently the only one is 'complete'. * Add prompt_for_password() to ask the user to enter a password when necessary. Passed to ClientManager in a new kward pw_func. Bug: 1355838 Change-Id: I9fdec9144c4c84f65aed1cf91ce41fe1895089b2
* Remove ClientManager._service_catalogDean Troyer2014-10-181-7/+7
| | | | | | | | | | Anything that needs a service catalog can get it directly from auth_ref.service_catalog, no need to carry the extra attribute. ClientManager.get_endpoint_for_service_type() reamins the proper method to get an endpoint for clients that still need one directly. Change-Id: I809091c9c71d08f29606d7fd8b500898ff2cb8ae
* Remove now-unnecessary client creation hacksDean Troyer2014-10-181-3/+0
| | | | | | | | | | | | | | | | | | | | Clients that can use ksc Session don't need the old junk to fake auth anymore: * compute * volume Clients that still need to be fed credentials can pick directly from the auth object in clientmanager. The _token attribute is removed, the token can be retrieved from the auth object: openstackclient/tests/common/test_clientmanager.py This change will break any plugin that relies on getting a token from instance._token. They should be updated to use the above, or preferable, to use keystoneclient.session.Session to create its HTTP interface object. Change-Id: I877a29de97a42f85f12a14c274fc003e6fba5135
* Merge "Add plugin to support token-endpoint auth"Jenkins2014-10-171-21/+20
|\
| * Add plugin to support token-endpoint authDean Troyer2014-10-121-21/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ksc auth plugins do not have support for the original token-endpoint (aka token flow) auth where the user supplies a token (possibly the Keystone admin_token) and an API endpoint. This is used for bootstrapping Keystone but also has other uses when a scoped user token is provided. The api.auth:TokenEndpoint class is required to provide the same interface methods so all of the special-case code branches to support token-endpoint can be removed. Some additional cleanups related to ClientManager and creating the Compute client also were done to streamline using sessions. Change-Id: I1a6059afa845a591eff92567ca346c09010a93af
* | Merge "Move plugin stuff to clientmanager"Jenkins2014-10-171-3/+27
|\ \
| * | Move plugin stuff to clientmanagerDean Troyer2014-10-131-3/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The OSC plugins work by adding an object as an attribute to a ClientManager instance. The initialization and management of thos plugins belongs in clientmanager.py. At this point the only part not moved is the API version dict initialization bcause the timing and connection to the CommandManager initialization. It gets refactored anyway when API discovery becomes operational. Change-Id: If9cb9a0c45a3a577082a5cdbb793769211f20ebb
* | | Merge "Add 'command list' command"Jenkins2014-10-142-0/+31
|\ \ \
| * | | Add 'command list' commandDean Troyer2014-10-082-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add method to CommandManager to retrieve command names by group * Add ListCommands To list command groups loaded by cliff Change-Id: I37fe2471aa2fafa8aa223159452d52b1981021d6
* | | | Fix operation on clouds with availability-zonesMonty Taylor2014-10-111-2/+2
| |/ / |/| | | | | | | | | | | | | | | | | | | | | | | In a cloud with AZs, you can get multiple entries back from the service catalog - one for each AZ and then one that is AZ agnostic that's tied to the region. If the region_name is plumbed all the way through, this works as intended. Change-Id: I3b365ea306e8111fc80830672ae8080a5d1dc8e0
* | | Add domain parameters to user show for Identity V3Steve Martinelli2014-10-091-3/+25
| |/ |/| | | | | | | | | | | | | | | | | | | 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
* | Support for keystone auth pluginsMatthieu Huin2014-10-091-81/+44
|/ | | | | | | | | | | | | | | | | | | | | | | This patch allows the user to choose which authentication plugin to use with the CLI. The arguments needed by the auth plugins are automatically added to the argument parser. Some examples with the currently available authentication plugins:: OS_USERNAME=admin OS_PROJECT_NAME=admin OS_AUTH_URL=http://keystone:5000/v2.0 \ OS_PASSWORD=admin openstack user list OS_USERNAME=admin OS_PROJECT_DOMAIN_NAME=default OS_USER_DOMAIN_NAME=default \ OS_PROJECT_NAME=admin OS_AUTH_URL=http://keystone:5000/v3 OS_PASSWORD=admin \ OS_IDENTITY_API_VERSION=3 OS_AUTH_PLUGIN=v3password openstack project list OS_TOKEN=1234 OS_URL=http://service_url:35357/v2.0 \ OS_IDENTITY_API_VERSION=2.0 openstack user list The --os-auth-plugin option can be omitted; if so the CLI will attempt to guess which plugin to use from the other options. Change-Id: I330c20ddb8d96b3a4287c68b57c36c4a0f869669 Co-Authored-By: Florent Flament <florent.flament-ext@cloudwatt.com>
* Update for cliff commandmanager >=1.6.1Dean Troyer2014-10-081-14/+4
| | | | | | | | | Cliff 1.6.1 added CommandManager.load_commands() so we can adopt it rather than rolling our own. Also, that second group is Greek, not Latin. Jeez... Change-Id: I4a63c22f37bcfd0ef5d83c2dbd08b58fda0db35c
* utils.find_resource does not catch right exceptionwanghong2014-09-241-2/+9
| | | | | | | | | Currently, utils.find_resource catch NotFound exception defined in openstackclient. However, different client libraries raise different exceptions defined in thire own library. Change-Id: Idc40428e30e59f71dbdbfa0555c0066fddc441c2 Closes-Bug: #1371924
* Use oslo.utilsOleksii Chuprykov2014-09-221-1/+2
| | | | | | | | Module `importutils` from common code was graduated to oslo.utils, so it would be great if we reuse this library. Remove unused strutils.py and gettextutils.py Change-Id: Iaae19fc5018d83103e5f15ff76d6da686bfdf5f8
* Merge "Add network extension list"Jenkins2014-09-181-13/+41
|\
| * Add network extension listTerry Howe2014-07-261-13/+41
| | | | | | | | | | | | | | Network extension list support Change-Id: I013f68ef2c3329c8db59e2441dd8d4ffafd4470e Closes-Bug: #1337685
* | Use Keystone client session.SessionDean Troyer2014-09-082-343/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This replaces the restapi requests wrapper with the one from Keystone client so we can take advantage of the auth plugins. As a first step only the v2 and v3 token and password plugins are supported. This maintainis no changes to the command options or environment variables. The next steps will include reworking the other API client interfaces to fully utilize the single auth session. Blueprint: ksc-session-auth Change-Id: I47ec63291e4c3cf36c8061299a4764f60b36ab89
* | Merge "Add action 'user password set' for identiy v3"Jenkins2014-09-071-3/+6
|\ \
| * | Add action 'user password set' for identiy v3Mouad Benchchaoui2014-09-071-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Merge "Unordered dicts and lists causes variable results"Jenkins2014-09-071-2/+2
|\ \ \
| * | | Unordered dicts and lists causes variable resultsTerry Howe2014-09-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The unordered dict and lists causes variable results. The user may see different results and tests can fail. Might as well make this more consistent. Change-Id: I7045b40b44cbf3ee0f2ca79c6ea0d279b6d8cfe3
* | | | Merge "Leverage openstack.common.importutils for import_class"Jenkins2014-09-071-13/+2
|\ \ \ \
| * | | | Leverage openstack.common.importutils for import_classAaron Rosen2014-09-061-13/+2
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch drops the import_utils method from common.utils and leverages it from openstack.common.importutils instead. Change-Id: If7e7383aa742afe44f750f916c0d90d747793150 Closes-bug: 1365273
* | | | Change app.restapi to app.client_manager.sessionDean Troyer2014-08-251-1/+13
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is step 1 toward using Keystone client's session.Session as the primary session/requests interface in OSC. * Move the session create into ClientManager and rename 'restapi' attribute to 'session' * Set up ClientManager and session loggers * Fix container and object command references to restapi/api Change-Id: I013d81520b336c7a6422cd22c05d1d65655e64f8
* | | Add container create and delete supportSteve Martinelli2014-08-031-3/+15
| | | | | | | | | | | | | | | | | | | | | Add basic container create and delete support to OSC. Change-Id: Ia104db9d7e580d33097ea33a5690998f817995d1 implements: bp swift-client
* | | Fix PEP8 E302 errorsDean Troyer2014-07-221-2/+2
| | | | | | | | | | | | | | | | | | Also add remaining skipped checks to HACKING Change-Id: I0c4333ce29597e0a8a233af17c15bed2b4d0711f
* | | Merge "Add basic timing support"Jenkins2014-07-112-2/+47
|\ \ \ | |_|/ |/| |
| * | Add basic timing supportDean Troyer2014-07-082-2/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for --timing options. Use cliff via a pseudo-command 'Timing' to support multiple outputformats. If an output format other than the default 'table' is selected use CSV since the timing data is in list form. Will pick up timing data for any client object that has a method similar to novaclient's get_timings(). TODO: * Stop instantiating all of the clientmanager client objects just to check for timing data. Descriptor magic required? Change-Id: I7f1076b7a250fba6a8b24b2ae9353a7f51b792b2
* | | Merge "Add support to list volume extensions"Jenkins2014-07-091-1/+15
|\ \ \
| * | | Add support to list volume extensionsSteve Martinelli2014-07-041-1/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since cinderclient has support to list extensions, we should add some of the logic to our list extensions command. Change-Id: I7dc7ca325ea9b82194bba6d875e7b8dc1884d77e Closes-Bug: #1337687
* | | | Merge "Add support to list compute extensions"Jenkins2014-07-081-9/+19
|\ \ \ \ | |/ / /
| * | | Add support to list compute extensionsSteve Martinelli2014-07-031-9/+19
| | |/ | |/| | | | | | | | | | | | | | | | | | | Since novaclient has support to list extensions, we should add some of the logic to our list extensions command. Closes-Bug: #1337684 Change-Id: I3074225780142df265a34add03e60c0f7c64c711
* | | Merge "Python 3: remove a useless code to safe_encode()"Jenkins2014-07-081-3/+1
|\ \ \ | |_|/ |/| |
| * | Python 3: remove a useless code to safe_encode()Cyril Roelandt2014-07-041-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | The safe_encode method returns bytes, so we cannot concatenate its output with text strings. This call does not seem needed after all, so let's just remove it. Change-Id: I6c18427559147d4c732ff7daa6d6006e7e5f6365
* | | Merge "Remove keyring support from openstackclient"Jenkins2014-07-041-60/+0
|\ \ \ | |/ / |/| |
| * | Remove keyring support from openstackclientAlex Gaynor2014-07-041-60/+0
| |/ | | | | | | | | | | | | | | * The encryption it purports to offer is completely insecure. * It also appears to be broken. Closes-Bug: #1319381 Change-Id: Id15ecfbbfd15f142b14c125bfd85afd5032699ac
* | trust authenticationMatthieu Huin2014-07-031-1/+3
|/ | | | | | | | | This patch enables authenticating by using a trust. The trust ID must be set with the parameter --os-trust-id or the env variable OS_TRUST_ID. Trusts are available for the identity v3 API. Co-Authored-By: Florent Flament <florent.flament@cloudwatt.com> Change-Id: Iacc389b203bbadda53ca31a7f5a9b8b6e1a1f522
* Fix PEP8 E265 errorsDean Troyer2014-06-271-10/+0
| | | | Change-Id: Ieb9a9af1da27d3935d1a4d3cfb61b0ccb03d099a
* Fix PEP8 H405 errorsDean Troyer2014-06-272-6/+18
| | | | Change-Id: Id9ea03e7d88148f84bffe1b18b5b4315e6123012
* Network CRUDTerry Howe2014-06-241-0/+10
| | | | | | | bp/neutron https://wiki.openstack.org/wiki/OpenStackClient/Commands#Network_2 Change-Id: I89ee083154afa544b03587e84becace36d9d522a
* Fix find_resource for keystone and cinderTerry Howe2014-06-171-13/+0
| | | | | | | | | | | | | | | | | | | The find_resource method had two hacks in in to support cinder and keystone and I have removed those in favor of a monkey patch for cinder. The find_resource method used to attempt to UUID parse the id, but it would do a manager.get anyway. I changed it to skip the UUID parsing. This will make things run minorly faster and it supports LDAP for keystone. The find_resource used to attempt to use display_name=name_or_id when finding. This was a hack for cinder support, but it breaks keystone because keystone totally messes up with the bogus filter and keystone refuses to fix it. Change-Id: I66e45a6341f704900f1d5321a0e70eac3d051665 Closes-Bug: #1306699
* Merge "Clean up logging levels"Jenkins2014-06-161-1/+0
|\
| * Clean up logging levelsDean Troyer2014-06-131-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The following logging levels are set according to the combination of --verbose, --quiet and --debug options: verbose_level logging level options 0 --quiet ERROR 1 (none) WARNING 2 --verbose INFO 3+ --verbose --verbose DEBUG or --debug Logging levels for the requests and iso8601 modules are forced to ERROR. This is the first step in bp use-logging-not-print The difference between '--debug' and '--verbose --verbose' is --debug triggers cliff's exception handling and traceback display. Change-Id: Ide2233b3316471d279260fb1e7255a6ca2072023
* | Add support for extension listMatt Fischer2014-06-111-0/+78
|/ | | | | | | | | | | | - Add support in the common section for extension list. This only supports Identity for now. Once the APIs for volume and compute are supported in the respective APIs, they will be added. Once network is added to this client, it will be added (the API already supports it). - Include extension fakes for volume and compute for pre-enablement. Change-Id: Iebb0156a779887d2ab06488a2a27b70b56369376 Closes-Bug: #1319115