Fix import of ironicclient to ironicclient/shell.py.
Reformat docstring in ironicclient/v1/shell.py.
Change-Id: Iad717d139ef423bb9f93050c6ba0c20fe1912a82
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
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
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 list and show commands to return the JSON
response body from the Ironic API without formatting it.
Change-Id: Ic21c8ce1cc211816e309b4a00b6e89a0a8bf6a9d
Closes-Bug: #1436440
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
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
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
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
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
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
cli did not handle output exception which is encoded,this patch
implements the shell encoding for exception output.
Change-Id: I7350c9be1bc0a7eafaaf2f992b7ef07bf84d44f8
Closes-Bug: 1437147
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
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
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
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
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
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
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
- 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
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
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
This modifies the help strings for timeout, os-service-type, and
os-endpoint-type arguments, to include the default values used.
Change-Id: I6bc9c243654b74550c60caf7fdb40e18addb3cd4
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
If you do 'ironic' or 'ironic help', it will show a list of subcommands.
This adds 'bash-completion' to that list.
The 'ironic bash-completion' subcommand lists all of the commands.
It won't include 'bash-completion' in this list, to be consistent with
nova's and keystone's bash-completion subcommand.
Change-Id: I7f2b76ad2885d9fe34dc91a97ee77984a21a27f4
Closes-Bug: #1304488
This commit adds the 'bash-completion' option to
ironic cli which prints all sub-commands and
options, and bash_completion scripts for bash
auto completion.
Change-Id: Ide5b29e262b4217046f124d86902cd0abfdab1b6
Closes-Bug: 1332408
This patch removes aliases in `ironicclient.common.utils` and starts
to use directly `arg` and `env` functions from common code.
Change-Id: Ied396b767e623fbcbf0c7a32326be7b64132b3e1
While not strictly necessary for files containing only ASCII
characters, adding a line with "coding: utf-8" can guard against
future SyntaxError's in case someone inserts a Unicode literal.
This commit adds such lines to all .py files. The syntax used by this
commit works with Python (of course). It also works with Emacs, which
will recognize the special "-*-" marker and use the "coding" variable
to correctly decode the file, even in an environment where UTF-8 is
not the default file encoding.
Existing coding lines were normalized to match the new lines added.
Partial-bug: #1325193
Change-Id: I58bf93fea711fd25890356a397e594bd820c99e3
There are some exception messages in common/utils.py and shell.py that
does not support i18n, this patch update the code to support it.
Change-Id: I836b892075333d48e4d1591986fec1362c84fc61
Partial-bug: #1240402
Needed to comply with new hacking>=0.8.0,<0.9 requirement.
Partial implement: blueprint py33-support
Change-Id: I478a47c814462a4f7edb0f389a00666bc901af77
Add short command line option alternative for resources creation. This
patch also sacrifices the short option used for debug (-d) in place of
improve the user experience for the real user, developers who needs to
enable debug can still use the long form alternative (--debug).
Change-Id: I1588dc453e1c432fd372e07b87978a77faddcd1c
Improve help strings, remove the upper and lower case mix, inform the
user that some fields are required, remove the period at the end of the
strings making them more uniform.
Change-Id: If5531e0f3161b74f29a80d61792746d561660f49
When an error occur instead of just return the HTTP response code the
client will now try to extract the error message that contains the reason
of the problem and show it to the user in a user-friendly way (no codes
at all), the intention of this patch is to improve the usability of the
ironic client. Things like HTTP response codes can still be viewed when
used with the debug mode enabled ( -d ).
Change-Id: Ieca021cc0e0eabe91c13335c3062ef9622da3004