| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
| |
This keeps testtools happy, since it expects the argument ordering to be
(expected, actual).
Change-Id: I95b41ad7645700ce23b46c7a5700e79008ed08be
Closes-bug: #1277104
|
| |
|
|
|
|
|
|
|
| |
Similar to commit dec9c9f35 and log_curl_request,
this ignores decoding errors when logging response
headers by passing errors='ignore' to safe_encode.
Change-Id: Ic915a7d8334e9473f300c9db670a3a8f5cda8976
Closes-Bug: #1369756
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This review implements blueprint python-request and replaces the old
http client implementation in favor of a new one based on
python-requests.
Major changes:
* raw_request and json_request removed since everything is now being
handled by the same method "_request"
* New methods that match HTTP's methods were added:
- get
- put
- post
- head
- patch
- delete
* Content-Type is now being "inferred" based on the data being sent:
- if it is file-like object it chunks the request
- if it is a python type not instance of basestring then it'll try
to serialize it to json
- Every other case will keep the incoming content-type and will send
the data as is.
* Glanceclient's HTTPSConnection implementation will be used if
no-compression flag is set to True.
Co-Author: Flavio Percoco<flaper87@gmail.com>
Change-Id: I09f70eee3e2777f52ce040296015d41649c2586a
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This debug line is causing tracebacks in the n-cpu logs for
tempest runs. Its because the logged data is sometimes unicode:
Traceback (most recent call last):
File "/usr/lib/python2.7/logging/__init__.py", line 846, in emit
msg = self.format(record)
File "/opt/stack/new/nova/nova/openstack/common/log.py", line 710, in format
return logging.StreamHandler.format(self, record)
File "/usr/lib/python2.7/logging/__init__.py", line 723, in format
return fmt.format(record)
File "/opt/stack/new/nova/nova/openstack/common/log.py", line 674, in format
return logging.Formatter.format(self, record)
File "/usr/lib/python2.7/logging/__init__.py", line 467, in format
s = self._fmt % record.__dict__
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1234: ordinal not in range(128)
Logged from file http.py, line 153
The change used correct encoding error handling policy for the log
which may includes non-ascii char.
Closes-bug: 1320655
Change-Id: I97f5f14b9beddcceb7fbd371062caf5a38a62a20
|
| |
|
|
|
|
|
| |
Set the environment variable PYTHONHASHSEED to 0 to have
predictive tests under Python 3.
Change-Id: Ia15a9383e0f20bd0e4572e9f9b9772f1704dff86
|
| |\ |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
On assertEqual, the order of parameters should be (expected, observed).
But, some part of glanceclient test were written with invalid order.
This patch fixes this problem.
Change-Id: I7722fdce766ce3cc5bc9944dc72d7d0af0b09f69
Partially-bug: #1277104
|
| |/
|
|
|
|
|
|
| |
Switch to using network_utils for splitting the URL. The code
in oslo-incubator supports ipv6 urls
Change-Id: I76be6173b97eb000319d30b4e9232a5a7c4a5aba
Closes-Bug: #1298137
|
| |
|
|
|
|
|
| |
This method takes bytes as input; the current code fails in Python 3.
Closes-Bug: #1281372
Change-Id: I070d9e9e07523c124f3168b55048fb9d1b338f69
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Some backend stores e.g. RBD, will fail if told to create an
image without a valid size (RBD will fail to write to a zero-size
image). Here we add support to allow the image size to be provided
when doing an upload. The result is that the upload content-length
will be set if available either from checking the supplied file
object or as provided by user.
Closes-Bug: 1220197
Change-Id: Ia1f2ea5680a139750d931591949b3e0058148b4b
|
| |
|
|
|
|
|
|
| |
Those modules have been combined in python 3. Therefore,
implementing the six module helps to have support to both versions.
Change-Id: I164a0f19790ff066d16d0cf4f0daa6f1097c848e
Closes-Bug: #1267181
|
| |
|
|
|
|
|
|
| |
In order to transition to a python 3.x compatible world,
lets switch to mox3 which is python 3.x compatible drop-in
replacement of mox.
Change-Id: Id971475f0e92900689d6784ffc55ae5fe63d9fe4
|
| |
|
|
|
|
|
| |
It’s an alias for StringIO.StringIO in Python 2 and
io.StringIO in Python 3.
Change-Id: I5316eaffa2d9d2d5679b85a901933ef0fbfcc2f7
|
| |
|
|
|
|
|
|
|
| |
* Fix "TypeError: not all arguments converted during string formatting"
* Add a UT case to cover the path where the bug is in
Change-Id: I91a137c5c3a9a3cc603804bef5eaea14ae281c08
Closes-Bug: #1265730
|
| |
|
|
|
|
| |
H306 - module imports should be in alphabetical order
Change-Id: I1f8fc25b0e6ca23c21c90bda420f42a45141c2e2
|
| |\ |
|
| | |
| |
| |
| |
| |
| |
| | |
According to http://docs.python.org/2/library/unittest.html
assertEquals is a deprecated alias of assertEqual.
Change-Id: I22f4702f41537c05684dfacb3f305627b36849c5
|
| |\ \ |
|
| | | |
| | |
| | |
| | |
| | | |
Change-Id: I38dcbcf1a6c8efe540fcf5f29e782cb3826e583d
Fixes-Bug: #1214176
|
| | |/
|/|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This adds six to the requirements.txt file in order to make
some HTTP-related imports work across Python 2's httplib and Python 3's
http.client modules. Tests were updated, including one change to the
location of HTTPConnection - moving it from being accessed where it was
imported rather than its canonical location inside of
six.moves.http_client.
Change-Id: Ibc4932b37dfdf195cd5091066914513af1876955
Signed-off-by: Chuck Short <chuck.short@canonical.com>
|
| |\ \ |
|
| | |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
After removing posixpath.normpath(url) in http.py, the code has a
regression bug that the url like 'http://example.com:80/test' can
not work. The code urlparse.urljoin() can not work as '%s%s' %
(self.endpoint_path, url).
Fixes bug #1230032
Change-Id: Ie7266fc3a067b92dfeed169086b4bf6a87dedbd6
|
| |/
|
|
|
|
|
|
|
|
| |
The code for processing an HTTP redirect included an incorrect method of
getting the Location header from an HTTPResponse. It needs to use the
getheader() method on the response, instead. This patch fixes that and
includes a unit test that covers this code path.
Change-Id: I0952fabad581b020dee07bdc4007b55b47c906aa
Closes-Bug: #1231524
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Add a new module that contain generic wrapper for file and iterator, which
are used to wrap image to upload and the request body iterator in upload and
download cases repectively, to show and advance a pretty progress bar when this
laters are consumed, The progress bar is triggered by adding a --progress command
line argument to commands: image-create, image-download or image-update.
Change-Id: I2ba42fd0c58f4fa087adb568ec3f08246cae3759
bug fix: LP#1112309
blueprint: progressbar-when-uploading
|
| |
|
|
|
|
|
|
|
|
|
| |
There is an upcoming patch in nova which passes identity
headers to glance client. We want to ensure that these get
passed to glance, which in turn with help the no auth
option in glance.
Resolves bug 1200761
Change-Id: Ifbef582aa4e64a2e7a46db43a9cc6cf8c3531dbd
|
| |
|
|
|
|
|
|
|
|
| |
Instead of globally ignoring pyflakes and
hacking warnings, only blacklist those that trigger
very frequently so far, in order to clean them
up in followup commits. Fix and start gating
on the rest already.
Change-Id: Ied7c7250061e3bf379e8286e8ce3b9e4af817faf
|
| |
|
|
|
| |
Change-Id: I5ce54117c5ac276fb9629c71eb16db88e078c947
Fixes: bug #1179984
|
| |
|
|
|
|
|
|
|
| |
The patch adds tests for headers encodings, incoming data decoding,
outgoing meta encoding and filters encoding.
Fixes bug: #1187013
Change-Id: I7e59bf6c44b9d188bd3faf32fc09f309f3ad67d3
|
| |
|
|
|
|
|
|
| |
Some mechanical translation of the deprecated
except x,y construct. Should work with Python >= 2.6
just fine
Change-Id: I394f9956b9e3e3d9f5f1e9ad50c35b13200af2a1
|
| |
|
|
|
|
|
| |
Add several tests for glanceclient.common.http module
Fixes: bug #1149445
Change-Id: I6a47c64e11cefea276163777dcd559316fc8e0ad
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Errors in name resolution have been logged previously with the url path
rather than the hostname. That resulted in incorrect errors like:
InvalidEndpoint: Error finding address for
/v1/images/detail?is_public=none&limit=20: [Errno -2]
Name or service not known
rather than one mentioning hostname itself. This patch changes the log
message to fit the situation.
Change-Id: I1eecbcb22d41b1341c214937b9cbfd046fd301a0
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently glanceclient doesn't support non-ASCII characters for images
names and properties (names and values as well). This patch introduces 2
functions (utils.py) that will help encoding and decoding strings in a
more "secure" way.
About the ensure_(str|unicode) functions:
They both try to use first the encoding used in stdin (or python's
default encoding if that's None) and fallback to utf-8 if those
encodings fail to decode a given text.
About the changes in glanceclient:
The major change is that all inputs will be decoded and will kept as
such inside the client's functions and will then be encoded before
being printed / sent out the client.
There are other small changes, all related to encoding to str,
around in order to avoid fails during some conversions. i.e: quoting
url encoded parameters.
Fixes bug: 1061150
Change-Id: I5c3ea93a716edfe284d19f6291d4e36028f91eb2
|
| |
|
|
|
|
| |
Part of blueprint grizzly-testtools
Change-Id: Ie914fd8f59cddb1a480566ec4eff908bfb51921c
|
| |
|
|
|
|
|
|
| |
Standardize pep8 to 1.3.3 and cleared up any errors
found by pep8 tests.
Change-Id: Ib7eb97d0789556d1676ccad58b5d3364065b7d15
Signed-off-by: Chuck Short <chuck.short@canonical.com>
|
| |
|
|
| |
Change-Id: I5e971b57a0591752e7fca76d0df78ce139308db5
|
|
|
When the server refuses the connection the error message displayed now
lists the endpoint that refused the connection.
Fixes: bug 1043067
Change-Id: I62797106732bbb6eec8c99e491fd38850ad58ff8
|