Commit 81a74561 authored by Stavros Sachtouris's avatar Stavros Sachtouris Committed by Giorgos Korfiatis

Check for invalid "/" character in container names

Affects the kamaki.cli.cmds.errors.Pithos.container CLI error
handler, which is used when a container name is present.
parent ac7de5ed
......@@ -574,7 +574,14 @@ class Pithos(object):
try:
return func(self, *args, **kwargs)
except ClientError as ce:
if ce.status in (404, ):
if '/' in getattr(self, 'container', ''):
raise CLIError(
'Invalid container name %s' % self.container,
importance=2, details=[
'"/" is an invalid character for containers',
'%s %s' % (getattr(ce, 'status', ''), ce)
])
elif ce.status in (404, ):
cont = ('%s or %s' % (self.container, dst_cont)) if (
dst_cont) else self.container
raise CLIError(
......
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