Revision 75e73aab
b/kamaki/clients/__init__.py | ||
---|---|---|
127 | 127 |
url += '%s%s%s' % (delim, key, ('=%s' % val) if val else '') |
128 | 128 |
delim = '&' |
129 | 129 |
parsed = urlparse(url) |
130 |
self.url = _encode(u'%s' % url) |
|
131 |
self.path = _encode((u'%s' % parsed.path) if parsed.path else '/') |
|
132 |
if parsed.query: |
|
133 |
self.path += '?%s' % parsed.query |
|
134 |
return (_encode(parsed.scheme), _encode(parsed.netloc)) |
|
130 |
self.url = '%s' % url |
|
131 |
self.path = (('%s' % parsed.path) if parsed.path else '/') + ( |
|
132 |
'?%s' % parsed.query if parsed.query else '') |
|
133 |
return (parsed.scheme, parsed.netloc) |
|
135 | 134 |
|
136 | 135 |
def __init__( |
137 | 136 |
self, method, url, path, |
... | ... | |
178 | 177 |
self.dump_log() |
179 | 178 |
conn.request( |
180 | 179 |
method=self.method.upper(), |
181 |
url=('%s' % self.path) or '',
|
|
180 |
url=self.path.encode('utf-8'),
|
|
182 | 181 |
headers=self.headers, |
183 | 182 |
body=self.data) |
184 | 183 |
sendlog.info('') |
... | ... | |
486 | 485 |
headers.setdefault('Content-Type', 'application/json') |
487 | 486 |
if data: |
488 | 487 |
headers.setdefault('Content-Length', '%s' % len(data)) |
489 |
|
|
490 | 488 |
plog = ('\t[%s]' % self) if self.LOG_PID else '' |
491 | 489 |
sendlog.debug('\n\nCMT %s@%s%s', method, self.base_url, plog) |
492 | 490 |
req = RequestManager( |
b/kamaki/clients/image/__init__.py | ||
---|---|---|
70 | 70 |
:returns: (list) id,name + full image info if detail |
71 | 71 |
""" |
72 | 72 |
path = path4url('images', 'detail') if detail else ( |
73 |
path4url('images') + '/')
|
|
73 |
'%s/' % path4url('images'))
|
|
74 | 74 |
|
75 | 75 |
async_params = {} |
76 | 76 |
if isinstance(filters, dict): |
... | ... | |
115 | 115 |
|
116 | 116 |
:returns: (dict) metadata of the created image |
117 | 117 |
""" |
118 |
path = path4url('images') + '/'
|
|
118 |
path = '%s/' % path4url('images')
|
|
119 | 119 |
self.set_header('X-Image-Meta-Name', name) |
120 | 120 |
location = location if ( |
121 | 121 |
isinstance(location, str) or isinstance(location, unicode)) else ( |
b/kamaki/clients/pithos/__init__.py | ||
---|---|---|
466 | 466 |
sendlog.info('%s blocks missing' % len(missing)) |
467 | 467 |
num_of_blocks = len(missing) |
468 | 468 |
missing = self._upload_missing_blocks( |
469 |
missing, |
|
470 |
hmap, |
|
471 |
f, |
|
472 |
upload_gen) |
|
469 |
missing, hmap, f, upload_gen) |
|
473 | 470 |
if missing: |
474 | 471 |
if num_of_blocks == len(missing): |
475 | 472 |
retries -= 1 |
Also available in: Unified diff