summaryrefslogtreecommitdiff
path: root/ironicclient/shell.py
Commit message (Collapse)AuthorAgeFilesLines
* Fix logging in the baremetal CLIDmitry Tantsur2022-05-231-9/+23
| | | | | | | | | | * Ask openstacksdk to log to stderr instead of stdout, otherwise its warnings break parsing the output. * Respect the --verbose flag (same as --debug but without tracebacks). * Do not propagate log records that are handled by either openstacksdk's or ours logging code. Change-Id: Ia191ab32f0d4f8f50cb266332d4f4bc96619cb58
* Made `baremetal <command> --help` display command specific help.Mahnoor Asghar2021-11-021-1/+2
| | | | | | | | | | `baremental node show --help` shows the same command-specific help message as: `baremetal help node show` Story: 2009265 Task: 43500 Change-Id: Id79a88a1df0e641d951e46433ad9961376241cc2
* Make baremetal --debug actually workDmitry Tantsur2021-03-221-0/+18
| | | | | | | The --debug option exists but does nothing. Wire in openstacksdk logging and make sure ironicclient can log as well. Change-Id: I136503f546be2ecbd3203ee07597df59a40a594e
* Standalone CLI: optional support for ironic-inspectorDmitry Tantsur2020-04-071-35/+80
| | | | | | | | To provide a `baremetal introspection` CLI interface similar to the existing OSC plugin, this change adds optional support for pulling commands from ironic-inspector-client. Change-Id: I61b82af3afdd934ed130d3d700de8ec7423a1328
* A standalone CLI for ironicDmitry Tantsur2020-04-061-0/+134
| | | | | | | | | This changes adds a new command ``baremetal`` that works mostly like the OSC ``openstack baremetal`` command but does not require OSC and defaults to no-auth. No changes in existing commands are required, the existing OSC plugins are pulled in. Change-Id: Id4895ec37bfb58eb635e5c8519f96f1bdc30c925
* Remove the ironic commandJulia Kreger2019-08-201-496/+0
| | | | | | | | | | | | | | | | | The ironic command is dead, long live the OSC baremetal command. Also removed the json_respose tests, which seemed ot be geared to checking json returned data on the command line. For ironic these tests seemed to be very explicit for our CLI where as OSC should be covering the return data handling, the only real end effect is field level expectation enforcement in the functional test... which seems excessive and un-needed. Story: 1726605 Task: 11974 Depends-on: https://review.opendev.org/677183 Change-Id: I3e3ae416a65d8e01956434ba51bd3187ab001f80
* Support node's deploy_step fieldRuby Loo2018-07-111-1/+1
| | | | | | | | | | | | Adds support for a node's ``deploy_step`` (read-only) field. The deploy step indicates which step is being performed during the deployment/provisioning of a node. It is available starting with Bare Metal API version 1.44. Depends-On: https://review.openstack.org/#/c/579968/ Change-Id: I93ac628bca0822a9a359926389543f7db7fb3e56 Story: #1753128 Task: #22925
* Switch to none auth for standalone modeVladyslav Drok2018-05-071-20/+59
| | | | | | | | | | | | | | | | | | | | | | Currently, during the ironic shell client construction, if only os_auth_token and endpoint arguments are passed, custom HTTPClient class based on requests' sessions is used. This is unnecessary, as there is admin_token auth type in keystoneauth that does basically the same, eliminating the need for our custom implementation. Apart from that, there is a none auth, which requires only passing the desired endpoint to use, so we can use it too without having to specify fake token strings anymore. Let's use these auth methods instead and deprecate HTTPClient. Also this patch deprecates a bunch of arguments to client.get_client function, changing them to the standard keystoneauth naming. DocImpact Story: 1696791 Task: 11836 Depends-On: https://review.openstack.org/559116 Change-Id: Ifc7b45d047c8882a41021e1604b74d17eac2e6e8
* Switch the deprecated "ironic" CLI to "latest" API version by defaultDmitry Tantsur2017-11-021-34/+27
| | | | | | | | The functional tests were updated to account for the initial state changed to "enroll" and for new fields appearing in "show" and "update" responses. Closes-Bug: #1671145 Change-Id: Ida18541fbbc8064868cac0accb6919de08e9f795
* Deprecate the ironic CLIRuby Loo2017-10-111-0/+4
| | | | | | | | | | The 'ironic' CLI is being deprecated; it is slated for removal in the S* release cycle. The 'openstack baremetal' CLI should be used instead. A message is printed out to that effect and the documentation is updated to reflect this. Change-Id: Ie6ac3c6222ec6a6231b9a9cb2949cac56b48967f Closes-Bug: 1700815
* Follow up to the API version warning patchesDmitry Tantsur2017-07-241-3/+5
| | | | | | | | | * Update the help string of --ironic-api-version and --os-baremetal-api-version to mention the future change. * Add missing dot to the warning issued by the "ironic" tool. Partial-Bug: #1671145 Change-Id: Ia03775a318008d0c740ce873ea037309290e33f8
* Log warning when API version is not specified for the ironic toolDmitry Tantsur2017-07-211-2/+14
| | | | | | | | | | | | | | At the Pike PTG, an issue was brought up regarding the use of an old API version in the ironic tool [0]. It was suggested that we begin printing a warning whenever the default API version is used and later default to using the latest API version when --ironic-api-version is unspecified. This patch adds this warning. [0] https://etherpad.openstack.org/p/ironic-pike-ptg-operations L30 Change-Id: I80d553e4d3b007d8312931019037f495425b5ea5 Partial-Bug: #1671145
* Fix ImportError when providing a meaningless API version.ericxiett2017-01-211-2/+23
| | | | | | | | | | Ironicclient parses subcommand by API version. When providing a meaningless (e.g 0.9) API version, the error message like 'No module named v0.shell' is not humanized. This patch provides the error more friendly. Change-Id: I1d5130cde8fd60234523701b97b9d29f27380e93 Closes-Bug: #1654186
* Simplify heading capitalization in shell's HelpFormatter.Vadim Hmyrov2016-12-201-3/+1
| | | | | | | Removed redundant expression for capitalizing the heading in HelpFormatter. Change-Id: I063960f6bb18486ce034ec2ae03b26cf8d63716f
* Use function import_versioned_module from oslo.utilsChangBo Guo(gcb)2016-11-021-1/+3
| | | | | | | | oslo.utils 3.17 provides similar function, just use it. Closes-Bug: #1627313 Change-Id: I1710faafd69cb098d603135ca8a158129edb6fec
* Fix import of ironicclient and reformat docstringKyrylo Romanenko2016-10-101-2/+1
| | | | | | | Fix import of ironicclient to ironicclient/shell.py. Reformat docstring in ironicclient/v1/shell.py. Change-Id: Iad717d139ef423bb9f93050c6ba0c20fe1912a82
* Fix i18n problems in shell.pyTang Chen2016-08-091-53/+51
| | | | | | Help msg and output info should support i18n. Change-Id: Ic0e0385773f0315103968bfb841c0c564530931d
* Make shell main() specify return value in exit codeTang Chen2016-07-301-3/+3
| | | | | | | | | | | | sys.exit() calls in main() will make the interactive python interpreter exit. We can call the main() as below to avoid to exit the interactive interpreter, and specify the return value of main() in the exit code at the same time. sys.exit(main()) Change-Id: I6ead9853fe27e99df3e9121478e906a06839f48c
* Remove httplib2Anton Arefiev2016-03-141-3/+0
| | | | | | | | | | It's used only for setup debug level info, but since HTTPClient switched to requests lib, it became useless. requests lib does no logging of its own. It's logging actually done by urllib3 and can be setup as usual logging level. Change-Id: I7df95e41d5f3a2406b43643bfa828b751faab116
* Merge "Remove leftover use of args.os_endpoint"1.2.0Jenkins2016-03-041-2/+1
|\
| * Remove leftover use of args.os_endpointVladyslav Drok2016-03-041-2/+1
| | | | | | | | | | | | It is now written to args.ironic_url. Change-Id: I353917ac7a526308661e3d113bd5a05b1695c5f4
* | Merge "Use keystoneauth instead of keystoneclient"Jenkins2016-03-031-198/+50
|\ \ | |/
| * Use keystoneauth instead of keystoneclientVladyslav Drok2016-03-031-198/+50
| | | | | | | | | | | | | | | | | | | | This change also enables client to be authenticated via 'token' keystone auth method, allowing to pass os_auth_token instead of os_username and os_password. Closes-bug: #1541411 Closes-bug: #1548907 Change-Id: I9739c95069ebf8d60f8362be154844e74334beb2
* | Add a JSON option to the clientAline Bousquet2016-03-021-0/+5
|/ | | | | | | | Add a json option to list and show commands to return the JSON response body from the Ironic API without formatting it. Change-Id: Ic21c8ce1cc211816e309b4a00b6e89a0a8bf6a9d Closes-Bug: #1436440
* Merge "Use keystoneclient.exception directly"Jenkins2015-11-181-1/+1
|\
| * Use keystoneclient.exception directlyLin Tan2015-11-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | keystoneclient.openstack.common.apiclient.exception was import in ironicclient/shell.py, but it's keystoneclient.exception indeed. And only ClientException was used. Meanwhile, apiclient is removed from oslo-incubator, so there is a potention change in keystoneclient. So use keystoneclient.exception directly. Change-Id: I87bab4396996e9b4f7be33643ae49599cb2f2f76
* | Sync with oslo-incubatorLin Tan2015-11-171-1/+1
|/ | | | | | | | | | | | | | According to the latest agreement in Oslo team, apiclient and clituils will be removed from Oslo incubator. We should keep the local copy by ourselfs: 1. rename openstack/common/apiclient to common/apiclient 2. Because Ironic only use base.py and exception.py, so delete others. 3. rename openstack/common/cliutils.py to common/clituils.py 4. Delete openstack/common/_i18n becuase we have common/i18n.py 5. Delete openstack folder because it is empty 6. Add related unit tests and add oslotest to test-requirements. Change-Id: I9eecd0457e86e82e65db1d0bc9a4c5c0ed4bbf74
* Cleanup session creationJamie Lennox2015-06-181-3/+0
| | | | | | | | | | | When using the session object we want to pass through unknown kwargs to the adapter so that keystoneclient can add new parameters as required. This requires fixing the old options so that we can restrict what is passed and showing a warning when there are values that are being ignored. Change-Id: Ia795dfc8e16c60a08df1636816daefe2ebbd0b03
* Register global Keystone args firstBen Nemec2015-06-161-6/+8
| | | | | | | | | As described in the referenced bug, registering the Keystone args last causes their default values to be ignored. Registering them first seems to prevent the problem. Change-Id: I8eb7882a0153fedbd6591dde2157df13fa2e5ba3 Closes-Bug: 1463581
* Consistent and more valid strings for BooleansRuby Loo2015-05-071-1/+5
| | | | | | | | | | | | | | | | | | | The set of valid input strings for Boolean values was inconsistent among the subcommands of the Ironic CLI. egs: -for node-set-console-mode: 'true', 'false' -for node-set-maintenance: 'on', 'off', 'true', 'false', 'True', 'False' This change allows the same set of valid values for all the subcommands: '0', '1', 'f', 'false', 'n', 'no', 'off', 'on', 't', 'true', 'y', 'yes'. For invalid strings, we output the subcommand usage along with the argument, invalid string, and valid string choices. At the API level, if NodeManager.set_maintenance() is passed an invalid state (maintenance mode) value, an InvalidAttribute exception is raised. Change-Id: I541695388489cdc640265df8ee6a9999e1442870 Closes-Bug: #1415943
* Merge "Remove unneeded 'utf-8' coding lines"Jenkins2015-04-221-2/+0
|\
| * Remove unneeded 'utf-8' coding linesJohn L. Villalovos2015-04-211-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is basically a revert of commit: af741ec2236619880fa902d68aef4a6ae6cef534 It was decided that only files that need to have the line: # -*- coding: utf-8 -*- Should have the line[1] as a general principle This patch removes the 'utf-8' coding line from files that consist entirely of ASCII characters. [1] http://eavesdrop.openstack.org/meetings/ironic/2015/ironic.2015-04-20-17.00.html Partial-bug: #1325193 Change-Id: I88c1c37f7b580aa805eae9d4a1e66d33302a325f
* | Merge "Encode exception on cli for UnicodeDecodeError"0.6.0Jenkins2015-04-211-1/+3
|\ \ | |/ |/|
| * Encode exception on cli for UnicodeDecodeErrorjiangfei2015-04-211-1/+3
| | | | | | | | | | | | | | | | cli did not handle output exception which is encoded,this patch implements the shell encoding for exception output. Change-Id: I7350c9be1bc0a7eafaaf2f992b7ef07bf84d44f8 Closes-Bug: 1437147
* | Implement and enable retries on ConflictDmitry Tantsur2015-04-171-0/+28
|/ | | | | | | | | | | Getting Conflict errors is pretty annoying, especially when writing automation scripts. Nova and ironic-discoverd already have their own logic for retrying on such errors. This patch adds 'max_retries' and 'retry_interval' arguments to get_client for tuning or disabling retries. Change-Id: Id9720c87ce3846faec61eb40ccf00970ca798ad2
* Use oslo.i18n libGhe Rivero2015-03-191-3/+1
| | | | | | | Stop using gettextutils from oslo.incubator and replace with the graduated library oslo.i18n Change-Id: I479be348f6e0894ecff5cd93d37ee66648f3ea01
* Merge "Fix two error strings in the CLI"Jenkins2015-03-131-5/+10
|\
| * Fix two error strings in the CLIDevananda van der Veen2015-03-071-5/+10
| | | | | | | | | | | | | | | | | | Two error strings in ironicclient/shell.py were not translated. This patch adds _() and also improves the clarity of one of the messages. Change-Id: I85a4db59aa486d7f7e1c901ab8b41668edd59acc
* | Fix the final PEP8 errorsJohn L. Villalovos2015-03-101-10/+12
|/ | | | | | | | | | | | | Fix PEP8 E126,E127,E128 errors, which were the only ones remaining. Fix PEP8 errors: E126: continuation line over-indented for hanging indent E127: continuation line over-indented for visual indent E128: continuation line under-indented for visual indent Remove the ignore= entries for flake8 in tox.ini Change-Id: I919551121d85d2aab528f4fa5ecdb3cfd940557a
* Fix typo on patch 155624Chris Krelle2015-03-061-1/+1
| | | | | | This is a follow up patch to correct a spelling issue with 155624. Change-Id: I56df414acb9fcccbd872f902e536a18c5474c1e0
* Enable ironicclient with --ironic-api-version 1.xLin Tan2015-03-061-5/+36
| | | | | | | | | | | | | python-ironic-client doesn't recognize API micro-version parameter. Reuse --ironic-api-version to recognize this. 1. The client accepts '1.x' or 'latest' as valid API version and send corresponding headers to Ironic. 2. If the user does not specify a version, client will not sent any extra headers to Ironic. It will use the minimum version. Closes-Bug: #1417430 Change-Id: I1db6e2f4e57d6d47d86f068018f143d0044b7211
* Fix PEP8 E121,E122,E123,E124,E125,E129 errorsJohn L. Villalovos2015-02-261-5/+5
| | | | | | | | | | | | | E121: continuation line under-indented for hanging indent E122: continuation line missing indentation or outdented E123: closing bracket does not match indentation of opening bracket's line E124: closing bracket does not match visual indentation E125: continuation line with same indent as next logical line E129: visually indented line with same indent as next logical line Remove E121,E122,E123,E124,E125, & E129 from the ignore list for flake8 Change-Id: I1b98335dd24086ab0271d25d662ad667ff8c5835
* cli support --os-endpointjiangfei2015-02-041-3/+13
| | | | | | | | | | | | ironicclient not support --os-enpoint: ironic --os-auth-token d7de11bba5984badb3e25533afec6ae6 --os-endpoint http://127.0.0.1:6385 node-list You must provide a username via either --os-username or via env[OS_USERNAME] Change-Id: I374203559c1636143bb3326d41bd230b7b4f79ec Closes-Bug: #1417406
* Add 'API' to description of ironic commandRuby Loo2014-11-201-1/+1
| | | | | | | | | | An 'ironic help' displays information about the ironic command. After the usage part, it shows 'Command-line interface to the OpenStack Bare Metal Provisioning'. This adds 'API.' to end that sentence. Change-Id: If41c326ab31a96894eccef0a37921945a1e21ecd
* Fix python-ironicclient crashArun S A G2014-10-281-3/+3
| | | | | | | | | | | - ca_file, cert_file and key_file arguements were renamed part of e3d35647 but the commit e3d35647 never renamed the other place this variables were used. - This commit properly renames those variables back to sane values and fixes the crash Change-Id: I7b40b2e6a314abc734d28b76626f09f3d31c0d8b Closes-Bug: 1386454
* Adds tty password entry for ironicclientJohn Trowbridge2014-10-221-2/+15
| | | | | | | | Added functionality from keystoneclient to fallback to the tty for password entry if no password is given via the environment or the --os-password option. Change-Id: I92da7112221c77efc220374617d503dc2184363e Closes-Bug: 1382146
* Add keystone v3 CLI supportDavid Hu2014-10-061-30/+211
| | | | | | | | This change allows user domains and tenant/project domains to be specified through CLI. This is necessary because keystone v2 API is deprecatedas of Icehouse. Change-Id: I50187a12b73777118ee77590202746b272ecc030
* Add defaults to the CLI help stringsRuby Loo2014-09-161-3/+6
| | | | | | | This modifies the help strings for timeout, os-service-type, and os-endpoint-type arguments, to include the default values used. Change-Id: I6bc9c243654b74550c60caf7fdb40e18addb3cd4
* Merge "handles keyboard interrupt"Jenkins2014-09-111-1/+3
|\
| * handles keyboard interruptRakesh H S2014-09-111-1/+3
| | | | | | | | | | | | | | | | | | | | When an user intentionally provides an keyboard interrupt, ironicclient throws the entire traceback on to the terminal instead of handling it. ironicclient will now handle the keyboard interrrupt and provides an crisp message on to the terminal. Change-Id: I8e657dc0cf64fa3396fb8fd32c5ffb57016ce864 Closes-Bug: #1367283