13 Commits

Author SHA1 Message Date
Martin Geisler
af741ec223 Add UTF-8 coding lines to all Python files
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
2014-05-31 13:22:44 +02:00
Jenkins
f5f043cbd3 Merge "Sync latest code and reuse exceptions from oslo" 2014-04-24 22:06:27 +00:00
Andrey Kurilin
0f6419015c Sync latest code and reuse exceptions from oslo
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
2014-04-24 12:01:31 +03:00
Dirk Mueller
96a9d788e1 Remove py3kcompat module
Remove use of py3kcompat module, which has been removed from oslo-incubator.
Replace it with six, which is already in the dependencies.

Update common apiclient from Oslo for that. I've updated
to oslo-incubator of commit 04a1abe59ac39890f57d2eed57d3d1b12bb5d757

List of recent changes:

04a1abe Revert "Removed set_loaded() method from Resource class"
86707cd Remove None for dict.get()
6650435 Fix usage of dict.keys in apiclient.exceptions
35dc1d7 py3kcompat: remove

Change-Id: Iab72688ea3ae7ff4c9c707b7939e1a12ff1a72b2
2014-04-15 16:19:47 +02:00
Victor Sergeyev
5585e5a008 Drop python2.5 suport in ironicclient.common.http
json and ssl modules were added in python 2.6 (see [1] [2]), so we should
suppose, that these module always available in python standard library.

[1] http://docs.python.org/2/library/ssl.html
[2] http://docs.python.org/2/library/json.html

Change-Id: I37d0cf7240180b0c2dbed26cfd9b264952ab822e
2014-01-14 09:56:55 +02:00
max_lobur
01c178de83 Let CLI print exception traceback from 'debuginfo'
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
2013-12-04 12:11:33 +02:00
Ghe Rivero
1b1dd31067 Reorder imports
As per hacking and PEP8, grouping third party libraries in
their own group.

http://www.python.org/dev/peps/pep-0008/#imports

Change-Id: I7a574d311b5171def0c6930162a46ce4c215097d
2013-11-11 18:12:58 +01:00
Ghe Rivero
8fefacfbae Comply with new hacking requirements
Fix some print statements and an import only module issue.

Change-Id: I0bb9cecb5ab03f35e696ee57c3ded05d7fd1725b
2013-11-11 11:44:46 +01:00
Kui Shi
acbe15cbd1 Import urlutils module from oslo
Import urlutils to resovle the urlparse module compatability issue.

Partial implement: blueprint py33-support

Change-Id: Ibc4860e979a2f25bebfbdc3a279ddc837b81b5a5
2013-10-17 17:21:06 +08:00
Kui Shi
b63721f2b3 Import httplib from six.moves
Import httplib from six.moves
Use six.StringIO to replace StringIO

Partial implement: blueprint py33-support

Change-Id: Ic20ce1139d1b296c7cbb666a200b2d9260764636
2013-10-17 17:21:02 +08:00
Lucas Alvares Gomes
489daf6710 Improve error feedback
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
2013-10-02 16:41:53 +01:00
Devananda van der Veen
2d7add0c21 Stop HTTPClient from calling self.auth_token()
self.auth_token is a string, not a method, and so it shouldn't be
invoked.

Change-Id: Iad5da176fd5c7ea05f16a29c83eb718fc900607c
2013-09-25 17:57:09 -07:00
Lucas Alvares Gomes
ba073c0707 Basic project structure
Mostly taken from other OpenStack client projects and adapted for Ironic.

Change-Id: I1ef9613b9e24bbb6caac9657dc1da3add899478e
2013-09-19 00:21:14 +01:00