summaryrefslogtreecommitdiff
path: root/troveclient/shell.py
Commit message (Collapse)AuthorAgeFilesLines
* Remove sixwangzihao2020-10-131-3/+2
| | | | | | Remove all usages of six. Change-Id: I6ea8d1cdc3060d5c2a4311c7454b66ba75109b0c
* Use importlib to take place of imp modulelikui2020-10-091-2/+10
| | | | | | | | | The imp module is deprecated[1] since version 3.4, use importlib to instead [1]: https://docs.python.org/3/library/imp.html Change-Id: Ifb44be3b0a0c35dd99d0230e9c371dfcb97f6fdd
* Stop to use the __future__ module.Hervé Beraud2020-06-021-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | The __future__ module [1] was used in this context to ensure compatibility between python 2 and python 3. We previously dropped the support of python 2.7 [2] and now we only support python 3 so we don't need to continue to use this module and the imports listed below. Imports commonly used and their related PEPs: - `division` is related to PEP 238 [3] - `print_function` is related to PEP 3105 [4] - `unicode_literals` is related to PEP 3112 [5] - `with_statement` is related to PEP 343 [6] - `absolute_import` is related to PEP 328 [7] [1] https://docs.python.org/3/library/__future__.html [2] https://governance.openstack.org/tc/goals/selected/ussuri/drop-py27.html [3] https://www.python.org/dev/peps/pep-0238 [4] https://www.python.org/dev/peps/pep-3105 [5] https://www.python.org/dev/peps/pep-3112 [6] https://www.python.org/dev/peps/pep-0343 [7] https://www.python.org/dev/peps/pep-0328 Change-Id: I73b532283079d346b75a925e2aee707c4de8fa9e
* Correct help in --profile argumentTovin Seven2017-07-141-3/+3
| | | | | | | HMAC key of OSprofiler can be configure in config files of Trove not in api-paste.ini (configs in paste are deprecated). Change-Id: I4904e5d0104e1cac12cc1f3e6dc38b6ef8372982
* Handle log message interpolation by the loggerGábor Antal2017-03-081-2/+2
| | | | | | | | | | | | | According to OpenStack Guideline[1], logged string message should be interpolated by the logger. Also, upgraded hacking requirement, to enable H904 check. [1]: http://docs.openstack.org/developer/oslo.i18n/guidelines.html#adding-variables-to-log-messages Co-Authored-By: jiansong <jian.song@easystack.cn> Change-Id: I3f020b6bcb1b9bf6d18a3b4f738c13cccd1bbff8 Closes-Bug: #1596829
* move old apiclient code out of openstack/commonSteve Martinelli2016-11-101-8/+3
| | | | | | | | | | | | | | | | | | | | | | | As part of the first community-wide goal [1], teams were asked to remove the openstack/common package of their projects if one existed. This was a byproduct of the old oslo-incubator form of syncing common functionality. The package, apiclient, was moved to a top level location and cliutils was moved to the common module. There are no oslo specific libraries, the recommended solution is to move it in tree and maintain it there. Specifically in this patch, I also rearranged some of the imports to make them match up with the hacking guidelines while I was re-ordering them for the refactor anyway. Lastly, the apiclient/fake_client.py was deleted since it was not used. [1] http://governance.openstack.org/goals/ocata/remove-incubated-oslo-code.html Change-Id: Ib7b691240b819c9c91b100ca47ffaba75b281c78
* Use i18n for shell.pyjiansong2016-09-231-50/+58
| | | | | | | | Help msg and output should support,This can be beneficial to the string type Partial-Bug: #1379001 Change-Id: I7d12aead49f5771f0762533ce9f53e477367101c
* switch to keystoneauthSteve Martinelli2016-05-221-58/+63
| | | | | | | move troveclient to keystoneauth as keystoneclient's auth session, plugins and adapter code has been deprecated. Change-Id: I3d57dde9c013038accbab8cc30d9622a142d0f71
* Added check to prevent adding argument without help stringTin Lam2016-04-121-0/+6
| | | | | | | | | Added addition check in add_argument() to ensure it has help message is always present per Amrith's suggestion in this review: https://review.openstack.org/#/c/261425/ Change-Id: Ic6486570d4beb138fdcd0c4e700ccc8d734d3e5e Closes-Bug: #1530195
* support OS_ENDPOINT_TYPE environment variableCraig Vyvial2016-02-041-1/+5
| | | | | | | | | Using the OS_ENDPOINT_TYPE environment variable if it exists, otherwise falling back to the TROVE_ENDPOINT_TYPE environment variable. Change-Id: I74f108a32877a5f80bd65961ca965f9f686379d2 Closes-Bug: #1541515
* Added '.' and remove extra parentheses(')') from README.rstamitg.b14@gmail.com2015-12-301-1/+2
| | | | | | | | | Set help parameter in troveclient/shell.py inside version agruments, default first letter was lowercase and period missing. Closes-Bug:1525550 Change-Id: Ia11f4fd5462487064a743697ebd95a46dd72b8e7
* Allow a user to pass an insecure environment variableCraig Vyvial2015-06-181-0/+3
| | | | | | Closes-Bug: #1466576 Change-Id: I66378e67cbbfbbfb0906743b74cd5bde7683432c
* Fixes new hacking rules1.2.0Sushil Kumar2015-05-261-3/+3
| | | | | | | | | | | | | | | | | Updated the hacking version as per global-requirements. Fixed some of new appearing hacking rules, as listed follows: - E128 continuation line under-indented for visual indent - E265 block comment should start with '# ' - E713 test for membership should be 'not in' - H238 old style class declaration, use new style (inherit from `object`) Rules which are not yet fixed have been incorporated to ignorelist - H405 Multi line docstrings should start with a one line summary followed by an empty line - H501 Do not use locals() or self.__dict__ for formatting strings Change-Id: I885c6fa8ad0e6a98f7a8479f3441ed08ed2cbaa6
* Drop use of 'oslo' namespace packageDoug Hellmann2015-05-061-2/+2
| | | | | | | | | | | | | | | | | | | | | The Oslo libraries have moved all of their code out of the 'oslo' namespace package into per-library packages. The namespace package was retained during kilo for backwards compatibility, but will be removed by the liberty-2 milestone. This change removes the use of the namespace package, replacing it with the new package names. The patches in the libraries will be put on hold until application patches have landed, or L2, whichever comes first. At that point, new versions of the libraries without namespace packages will be released as a major version update. Please merge this patch, or an equivalent, before L2 to avoid problems with those library releases. Blueprint: remove-namespace-packages https://blueprints.launchpad.net/oslo-incubator/+spec/remove-namespace-packages Change-Id: I2a8caa859830b3416bfe54e4261dd3415ac5a76a
* Fix grammatical errors in profiler messagesPeter Stachowski2015-02-131-10/+9
| | | | | | | | | While testing the osprofiler code, certain grammatical inconsistencies were found in the help/messages. These have been fixed. Change-Id: Ia0b81870e15a9bc118bcaa81e698ef0e44c96f94
* Handle obsolete and unused oslo modulesAmrith Kumar2015-01-231-7/+9
| | | | | | | | The python-troveclient module still had references to strutils, and gettextutils which are now obsolete. Change-Id: Ia54a565c00966b0a1cb5f18c6e17e1237b2bfee6 Partial-Bug: #1380789
* Merge "Remove RAX-specific auth in troveclient"Jenkins2014-12-101-27/+45
|\
| * Remove RAX-specific auth in troveclientSwapnil Kulkarni2014-12-091-27/+45
| | | | | | | | | | | | | | | | | | Author: Swapnil Kulkarni <swapnilkulkarni2608@gmail.com> Co-Authored-By: Nikhil Manchanda <SlickNik@gmail.com> Co-Authored-By: Craig Vyvial <cp16net@gmail.com> Change-Id: I250777890a1f5240c5f14290cf02eb5a7b34b434 Closes-Bug: #966329
* | Add profiling support to Trove clientZhi Yan Liu2014-12-101-1/+30
|/ | | | | | | | | | | | | | | | | | | | | To be able to create profiling traces for Trove, client should be able to send special HTTP header that contains trace info. This patch is as well important to be able to make cross project traces. (Typical case horizon calls Trove via python client, if profiler is initialized, Trove client will add extra header, that will be parsed by special osprofiler middleware in Trove api) Don't worry no security issue here, trace information is signed by HMAC key that is setted in api-paste.ini. So only person that knows HMAC key is able to send proper header. Main patch in Trove is: I580cce8d2b3c4ec9ce625ac09de6f14e1249f6f5 We prepared a common BP in oslo-spec due to integration change is similar to all projects: I95dccdc9f274661767d2659c18b96da169891f30 Currently there are 2 other projects are using osprofiler: Glance & Cinder, and some others are working in progress. Change-Id: I5a76e11d428c63d33f6d2c2021426090ebf8340c Signed-off-by: Zhi Yan Liu <zhiyanl@cn.ibm.com>
* Adds support for Keystone V3 APIBob Thyne2014-12-011-76/+127
| | | | | | | | | | | | | | | Updated trove client to support Keystone V3 API. The Keystoneclient session object is used for authentication, retrieving the service catalog and HTTP connection/session management. Added additional CLI parameters for Keystone V3. Added tests using requests_mock instead of mocking completely the session object like the previous failed patch: https://review.openstack.org/#/c/102315 Change-Id: Ib804c0a45b3b4d3f8670ec642b2c2fd1be6cd656
* Reverse fix for 1323866 as it regressed trove CLIAmrith Kumar2014-11-101-116/+71
| | | | | | | | | | | | | | | | | | | Trove CLI appears to be broken (fresh checkout, devstack as well as openstack gate). All commands fail with ERROR: __init__() got an unexpected keyword argument 'http_log_debug' Correcting the obvious place where this appears to be an issue is causing additional failures and as it is time-critical to get this back up and running, I'm proposing a reversal of the change from 3c47a1855b7ee1345dadfb00ae90a6279b7c424e while that change is completely reworked. I will ping trove core for an approval on this and if I don't get an approval, I'll fast track this reversal. Change-Id: Icac028cfafac57c7e3ef03d4277ae2b7833bf58f Partial-Bug: 1391840
* Adds support for Keystone V3 APIdaniel-a-nguyen2014-11-051-71/+116
| | | | | | | | | | | Updated trove client to support Keystone V3 API. The Keystoneclient session object is used for authentication, retrieving the service catalog and HTTP connection/session management. Added additional CLI parameters for Keystone V3. Change-Id: I800c252234be2ff11d818cf7513c61c5431eb15c Closes-Bug: 1323866
* Use JSON instead of json in the parameter descriptionsChristian Berendt2014-07-161-1/+1
| | | | | | | This change only changes the wording of a help string. It should be 'JSON' instead of 'json'. Change-Id: I11796e8aa6e475790838db44206e8ed85ebb1505
* Overwrite HelpFormatter constructur to extend argument columnChristian Berendt2014-06-051-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Overwrite the HelpFormatter constructor in the class OpenStackHelpFormatter to modify the default value of the max_help_position to extend the width of the argument column in the help output. example output before this patch: configuration-attach Attaches a configuration group to an instance. configuration-create Creates a configuration group. configuration-default Shows the default configuration of an instance. configuration-delete Deletes a configuration group. configuration-detach Detaches a configuration group from an instance. example output after this patch: configuration-attach Attaches a configuration group to an instance. configuration-create Creates a configuration group. configuration-default Shows the default configuration of an instance. configuration-delete Deletes a configuration group. configuration-detach Detaches a configuration group from an instance. Change-Id: Ia3ad8e9fefca6da40f55ab3de902c015a0d17006 Closes-Bug: #1326471
* Merge "fixed several pep8 issues"Jenkins2014-05-281-3/+3
|\
| * fixed several pep8 issuesChristian Berendt2014-05-131-3/+3
| | | | | | | | | | | | | | | | | | | | * E265 block comment should start with '# ' * E128 continuation line under-indented for visual indent * E713 test for membership should be 'not in' Tested with pep8 version 1.5.6 (2014-04-14). Change-Id: If2853c79bea91ebef5cd97dff66788b46b174a9a
* | Merge "replaced e.message"Jenkins2014-05-231-1/+1
|\ \
| * | replaced e.messageChristian Berendt2014-05-161-1/+1
| |/ | | | | | | | | | | | | | | | | | | | | BaseException.message has been deprecated as of Python 2.6. http://legacy.python.org/dev/peps/pep-0352/ Replaced e.message with six.text_type(e) (uses unicode with Python 2.x and str with Python 3.x). Change-Id: I590749a1d05f39350996ec5ce5838b9c90baeb92
* | Enabled F821, H306, H402, and H404 flake8 ruleSushil Kumar2014-05-091-6/+6
|/ | | | | | | | | | | | | | Reasons: - F821 is disabled. - H306 is disabled. - H402 is disabled. - H404 is disabled. Changes: - Updates tox.ini to enable F821, H306, H402 and H404 rules. - Updates code for F821, H306, H402 and H404 violation. Change-Id: I772270bb833ac774e080fc63e330d6b333f23de2
* Merge "Improve help strings"Jenkins2014-03-181-11/+11
|\
| * Improve help stringsAndreas Jaeger2014-03-111-11/+11
| | | | | | | | | | | | | | | | | | | | Make help strings more consistent: * Fix spelling and capitalization * Add "." at end of each string * Fix spaces. * Improve wording Change-Id: I22e84ebecb87f1c803cfb8369db3798fe56903ff
* | Remove arguments deprecated after DiabloGreg Lucas2014-03-131-57/+14
|/ | | | | Change-Id: Ia65ee002ad2aa2b6d2401586d1e06b8ffdb633dd Closes-Bug: #1279483
* Remove vim headerHe Yongli2014-02-161-2/+0
| | | | | | | | | | | No need to set tabstop tons of times, this can be set in your vimrc file instead. More disucssion: http://openstack.10931.n7.nabble.com/Remove-vim-modelines-td21780.html Change-Id: I45766d91f0c0b3622bbdc7dc5517497c87ebee8c Closes-Bug: #1229324
* Support Extensions to Trove Clientamcrn2014-01-231-6/+20
| | | | | | | | | | | | | | extensions on the contrib path (i.e. troveclient/v1/contrib/*.py), extensions on the python path that follow the naming convention of *_python_troveclient_ext, and entry-points will now be discovered and loaded. due to the mismatch of the api version and the troveclient package name, '1.0' vs. '1', the client has been patched to look for contrib in troveclient/v1 vs. the standard troveclient/v1_0 Change-Id: I3ea7bb5ba471b0d421581dcfda7216f429cb7b65 Closes-Bug: #1267577
* Fixed misspellings of common wordsSushil Kumar2014-01-141-1/+1
| | | | | | | Fixed misspelling of common words found by the 'misspellings' tool. Change-Id: I8e03379f92b62fd4856bbc74b7e4641226a403d3 Closes-Bug: #1257531
* Fixes trove help commandSushil Kumar2013-12-121-2/+9
| | | | | | | | | | | | | | Reason: - trove help output misplaces the position of "<subcommand> ..." from bottom to top. - This behavior is because of formatting done to Print positionals before optionals. Changes: - Sequence fixed in trove help output. Change-Id: I8aff2eec9f915a7ec1960b67ee7ba8423624aad6 Closes-Bug: #1260332
* Ignore fewer PEP8/flake8 rulesDenis Makogon2013-12-101-2/+2
| | | | | | | | | | | | Reasons: - code should be pythonicaly clean, that is why number of ignored rules should reduced Changes: - E125, F811, H102, H103, F201, H23, H302, F841, H301, H702, H703 rules are now enabled Change-Id: Ibf4025162244d3c2f1278b49a76ec1527a729042
* Allow --json output override printing dict/listNick Shobe2013-11-211-0/+14
| | | | Change-Id: Ib02f244cb969ac8dfc92ac94e6e915063d13764d
* Merge "Usage String has Positionals after Optionals"Jenkins2013-11-131-2/+101
|\
| * Usage String has Positionals after Optionalsamcrn2013-10-251-2/+101
| | | | | | | | | | | | | | | | | | | | | | | | print positionals before optionals in the usage string to help users avoid argparse nargs='*' problems. ex: 'trove create --databases <db_name> <name> <flavor_id>' fails with 'error: too few arguments', but this succeeds: 'trove create <name> <flavor_id> --databases <db_name>' Change-Id: I400c9f0ca5580bd287c5f3bcf935352e88071bc8 Closes-Bug: #1243981
* | Fix Pep8 indentation issues only found with Pep8 1.4.6+Dirk Mueller2013-11-011-4/+6
| | | | | | | | Change-Id: Iea9821b95278f1853e5fe98b21c61cb3e9e42da8
* | Merge "Add --bypass-url option to trove client"1.0.3Jenkins2013-10-251-3/+12
|\ \ | |/ |/|
| * Add --bypass-url option to trove clientdaniel-a-nguyen2013-10-211-3/+12
| | | | | | | | | | Change-Id: Ie0596f2dd302eec293f3a5ab3306d56fb0fdcdb8 Closes-Bug: #1240285
* | Fixing copyright and license headersMichael Basnight2013-10-221-1/+4
|/ | | | | | * Added HP copyrights as appropriate Change-Id: If4f30b0caf03b16f5fb4f54185ba80d9fa41d0b0
* Add support for a service type env var1.0.0Monty Taylor2013-10-091-0/+2
| | | | | | | Rackspace is currently setting their service types to weird things. Support them, because we love special snowflakes. Change-Id: I1519be00a3086945338a953bc2a1e7a4e0e65400
* Massive refactoring to the troveclientMichael Basnight2013-10-091-0/+533
The new client adheres to the standards of the other clients now. It prints out tables, uses ENVVAR's for auth, no longer stores pickled json in a login token, uses openstack common, and moves the cli operations into a v1 module for the future of trove when it has a v2 api. Please note for compatibility, the troveclient.compat module has the old cli. In order to deploy it, amend the setup.cfg to include the compat module. implements blueprint cli-compliance-upgrade Change-Id: Ie69d9dbc75ce90496da316244c97acca1877a327