diff --git a/swift/cli/info.py b/swift/cli/info.py index 529f210434..7826a17b81 100644 --- a/swift/cli/info.py +++ b/swift/cli/info.py @@ -93,11 +93,12 @@ def curl_head_command(ip, port, device, part, target, policy_index): else: formatted_ip = ip - cmd = 'curl --path-as-is -g -I -XHEAD "http://%s:%s/%s/%s/%s"' % ( + cmd = 'curl -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', policy_index) + cmd += ' --path-as-is' return cmd diff --git a/test/unit/cli/test_info.py b/test/unit/cli/test_info.py index 5bef9f8114..80813db87d 100644 --- a/test/unit/cli/test_info.py +++ b/test/unit/cli/test_info.py @@ -1277,9 +1277,9 @@ class TestPrintObjFullMeta(TestCliInfoBase): os.chdir(cwd) exp_curl = ( - 'curl --path-as-is -g -I -XHEAD ' + 'curl -g -I -XHEAD ' '"http://{host}:{port}/{device}/{part}/AUTH_admin/c/obj" ' - '-H "X-Backend-Storage-Policy-Index: 2"').format( + '-H "X-Backend-Storage-Policy-Index: 2" --path-as-is').format( host=node['ip'], port=node['port'], device=node['device'], @@ -1318,9 +1318,10 @@ class TestPrintObjFullMeta(TestCliInfoBase): os.chdir(cwd) exp_curl = ( - 'curl --path-as-is -g -I -XHEAD ' + 'curl -g -I -XHEAD ' '"http://[{host}]:{port}' - '/{device}/{part}/AUTH_admin/c/obj" ').format( + '/{device}/{part}/AUTH_admin/c/obj" ' + '-H "X-Backend-Storage-Policy-Index: 3" --path-as-is').format( host=node['ip'], port=node['port'], device=node['device'],