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:
parent
ae85ee2474
commit
5c087ad7b9
@ -92,7 +92,7 @@ def curl_head_command(ip, port, device, part, target, policy_index):
|
|||||||
else:
|
else:
|
||||||
formatted_ip = ip
|
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))
|
formatted_ip, port, device, part, urllib.parse.quote(target))
|
||||||
if policy_index is not None:
|
if policy_index is not None:
|
||||||
cmd += ' -H "%s: %s"' % ('X-Backend-Storage-Policy-Index',
|
cmd += ' -H "%s: %s"' % ('X-Backend-Storage-Policy-Index',
|
||||||
|
@ -1200,7 +1200,7 @@ class TestPrintObjFullMeta(TestCliInfoBase):
|
|||||||
os.chdir(cwd)
|
os.chdir(cwd)
|
||||||
|
|
||||||
exp_curl = (
|
exp_curl = (
|
||||||
'curl -g -I -XHEAD '
|
'curl --path-as-is -g -I -XHEAD '
|
||||||
'"http://{host}:{port}/{device}/{part}/AUTH_admin/c/obj" '
|
'"http://{host}:{port}/{device}/{part}/AUTH_admin/c/obj" '
|
||||||
'-H "X-Backend-Storage-Policy-Index: 2"').format(
|
'-H "X-Backend-Storage-Policy-Index: 2"').format(
|
||||||
host=node['ip'],
|
host=node['ip'],
|
||||||
@ -1241,7 +1241,7 @@ class TestPrintObjFullMeta(TestCliInfoBase):
|
|||||||
os.chdir(cwd)
|
os.chdir(cwd)
|
||||||
|
|
||||||
exp_curl = (
|
exp_curl = (
|
||||||
'curl -g -I -XHEAD '
|
'curl --path-as-is -g -I -XHEAD '
|
||||||
'"http://[{host}]:{port}'
|
'"http://[{host}]:{port}'
|
||||||
'/{device}/{part}/AUTH_admin/c/obj" ').format(
|
'/{device}/{part}/AUTH_admin/c/obj" ').format(
|
||||||
host=node['ip'],
|
host=node['ip'],
|
||||||
|
Loading…
Reference in New Issue
Block a user