Fix up curl commands when object name has unix dir characters

If an object name has something like /./ in it then curl will
resolve this. Need to use --path-as-is option for curl

Change-Id: I4e45cb62d41f6aada4fdbb00d86b4bd737b441ee
Closes-Bug: #1885244
This commit is contained in:
Sam Morrison 2020-06-26 13:39:59 +10:00
parent ae85ee2474
commit 5c087ad7b9
2 changed files with 3 additions and 3 deletions

View File

@ -92,7 +92,7 @@ def curl_head_command(ip, port, device, part, target, policy_index):
else:
formatted_ip = ip
cmd = 'curl -g -I -XHEAD "http://%s:%s/%s/%s/%s"' % (
cmd = 'curl --path-as-is -g -I -XHEAD "http://%s:%s/%s/%s/%s"' % (
formatted_ip, port, device, part, urllib.parse.quote(target))
if policy_index is not None:
cmd += ' -H "%s: %s"' % ('X-Backend-Storage-Policy-Index',

View File

@ -1200,7 +1200,7 @@ class TestPrintObjFullMeta(TestCliInfoBase):
os.chdir(cwd)
exp_curl = (
'curl -g -I -XHEAD '
'curl --path-as-is -g -I -XHEAD '
'"http://{host}:{port}/{device}/{part}/AUTH_admin/c/obj" '
'-H "X-Backend-Storage-Policy-Index: 2"').format(
host=node['ip'],
@ -1241,7 +1241,7 @@ class TestPrintObjFullMeta(TestCliInfoBase):
os.chdir(cwd)
exp_curl = (
'curl -g -I -XHEAD '
'curl --path-as-is -g -I -XHEAD '
'"http://[{host}]:{port}'
'/{device}/{part}/AUTH_admin/c/obj" ').format(
host=node['ip'],