url += '%s%s%s' % (delim, key, ('=%s' % val) if val else '')
delim = '&'
parsed = urlparse(url)
- self.url = _encode(u'%s' % url)
- self.path = _encode((u'%s' % parsed.path) if parsed.path else '/')
- if parsed.query:
- self.path += '?%s' % parsed.query
- return (_encode(parsed.scheme), _encode(parsed.netloc))
+ self.url = '%s' % url
+ self.path = (('%s' % parsed.path) if parsed.path else '/') + (
+ '?%s' % parsed.query if parsed.query else '')
+ return (parsed.scheme, parsed.netloc)
def __init__(
self, method, url, path,
self.dump_log()
conn.request(
method=self.method.upper(),
- url=('%s' % self.path) or '',
+ url=self.path.encode('utf-8'),
headers=self.headers,
body=self.data)
sendlog.info('')
headers.setdefault('Content-Type', 'application/json')
if data:
headers.setdefault('Content-Length', '%s' % len(data))
-
plog = ('\t[%s]' % self) if self.LOG_PID else ''
sendlog.debug('\n\nCMT %s@%s%s', method, self.base_url, plog)
req = RequestManager(
:returns: (list) id,name + full image info if detail
"""
path = path4url('images', 'detail') if detail else (
- path4url('images') + '/')
+ '%s/' % path4url('images'))
async_params = {}
if isinstance(filters, dict):
:returns: (dict) metadata of the created image
"""
- path = path4url('images') + '/'
+ path = '%s/' % path4url('images')
self.set_header('X-Image-Meta-Name', name)
location = location if (
isinstance(location, str) or isinstance(location, unicode)) else (
sendlog.info('%s blocks missing' % len(missing))
num_of_blocks = len(missing)
missing = self._upload_missing_blocks(
- missing,
- hmap,
- f,
- upload_gen)
+ missing, hmap, f, upload_gen)
if missing:
if num_of_blocks == len(missing):
retries -= 1