This change adds --wait[=timeout] flag for all provisioning actions but abort.
It also adds a helper node method wait_for_provision_state to back this flag.
The wait is aborted with an error in any of the following cases:
* node.last_error gets set
* unexpected stable state was reached (e.g. available instead of active)
* a failure state was reached
Change-Id: I8ba5c7da8980e932a578b084167b00e2b20f6daf
Partial-Bug: #1590752
The exceptions.from_response() from the common.apiclient.exceptions
module takes 'method' as it's second param.
Co-Authored-By: Lucas Alvares Gomes <lucasagomes@gmail.com>
Closes-Bug: #1520528
Change-Id: I7d59c2f6dcdf181f561f38f95b460e556e8b6d9e
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
This reverts the fix to properly issue an Unauthorized
exception [1] because it was a workaround, and the proper fix
was made in oslo.incubator [2] and has been sync'd [3].
[1] I930fd61a896f62a2984cca1e4d40e5d89644aa3f
[2] I3b9a20174da482f570d02319e68f46dcaa10ca9c
[3] Iab799c8209872e2faa9ec6d33a426347b6478cce
Change-Id: Ia3f5695f73bfff19a9f24117fa881e8d9ed039d3
Closes-Bug: #1402840
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
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
When the ironic-api returns an error code 400-600 when,
SessionClient faultstring did not return to the user,
it should return a detailed error message to the user,
not simply bad request.
we use the ironic node-show aa938513a-216a-49dc-b801-08119ebc2b21
SessionClient will get the below message:
"Not Found (HTTP 404)" -->
"Node a938513a-216a-49dc-b801-08119ebc2b21 could not be
found. (HTTP 404)"
Change-Id: If57fd938cdb29d0349b923ca5dc1a804f1accd9d
Closes-Bug: #1402893
This change adds a small workaround in exc.py to avoid a situation
where an HTTP response that has a content-type of 'text/*' but
no text attribute will trigger an AttributeError exception in
the openstack.common.apiclient.exceptions module.
Added a test to make sure the ironic client throws an 'Unauthorized'
exception when it encounters a 401 Unauthorized HTTP response instead
of the observed behavior of throwing an inappropriate AttributeError
exception.
The workaround mentioned above corrects the tested behavior.
Change-Id: I930fd61a896f62a2984cca1e4d40e5d89644aa3f
Partial-Bug: #1402840
Current hacking version is incompatible with the one in the
global requirements. Match the hacking module version and made the
necessary changes to pass the tests.
Change-Id: Ie6b13a4ea112084d4c50dc27f97329dfad5777a1
Class name AmbigiousAuthSystem in exc.py is misspelled.
To fix the issue, this patch renames AmbigiousAuthSystem to
AmbiguousAuthSystem in exc.py and creates an alias for compatibility.
Also edits the use of the class in client.py accordingly and adds an
additional assertRaises() to
test_client.py.test_get_client_no_url_and_no_token to test both the
correct exception and the alias.
Change-Id: I18309b045d5eb9e81c72b1ed9de350925927db66
Closes-Bug: 1356512
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
Module `ironicclient.exc` contains exceptions which equal to exceptions
from oslo common code.
This patch:
- sync latest code of `apiclient.exceptions`(hash of last commit in oslo
related to apiclient.exceptions: 3570f44d5ccf52c59cc586bed1446b874fc3c07c)
- reuses exceptions from common code
- removes needless exceptions from `ironicclient.exc`
Related to bp common-client-library-2
Change-Id: I784007f36dd6a63fc4c77e0d0f0f000e05eb792f
Raise an exception if configured credentials are not sufficient
for obtaining an endpoint and token.
Change-Id: Ie11a25eb67da2d2c2c8ef40ab984eb2ecb77fdf9
Closes-Bug: 1290601
Response 'debuginfo' is used to carry server traceback in case of
error. If 'debuginfo' is not empty, append it to exception message,
so traceback will be printed together with message.
Change-Id: Id7900b64ec7fc9f906253ef0e2d754c2baa76067
Closes-Bug: #1255590
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