Commit f91bc6b1 authored by Stavros Sachtouris's avatar Stavros Sachtouris
Browse files

Add info in container-not-found error

parent b9b7bd83
......@@ -128,13 +128,24 @@ class test_prints(_test_init):
l2 = [d2, l1, d1]
d3 = {'dict 1': d1, 'dict 2': d2, 'list2': l2,
'long key of size 75 characters is used to' +\
' check the effects on total result': l1}
def main(self):
from utils import print_dict, print_list
print('- - -\nTest simple dict')
print('\n- - -\nTest simple list')
print('- - -\nTest 2-level dict')
from kamaki.cli.utils import print_dict, print_list
print('Test simple dict:\n- - -')
print('\n- - -\nTest non-trivial list')
print('- - -\n')
print('\nTest simple list:\n- - -')
print('- - -\n')
print('\nTest 2-level dict:\n- - -')
print('- - -\n')
print('\nTest non-trivial list:\n- - -')
print('- - -')
print('\nTest extreme dict:\n- - -')
print('- - -\n')
......@@ -98,8 +98,13 @@ def print_list(l, exclude=(), ident=0):
raiseCLIError(TypeError('Cannot list_print a non-list object'))
if l:
margin = max(len(unicode(item).strip())\
for item in l if item not in exclude)
margin = max(len(unicode(item).strip()) for item in l\
if not (isinstance(item, dict)\
or isinstance(item, list)\
or item in exclude))
except ValueError:
margin = 0
for item in sorted(l):
if item in exclude:
......@@ -758,8 +758,14 @@ class PithosClient(PithosRestAPI):
:param until: (str) formated date
:returns: (dict)
:raises ClientError: 404 Container not found
r = self.container_head(until=until)
r = self.container_head(until=until)
except ClientError as err:
err.details.append('for container %s' % self.container)
raise err
return r.headers
def get_container_meta(self, until=None):
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment