Curl statements to include globoff for IPv6 URLs
Novaclient displays curl statements for debugging/troubleshooting purposes. For IPv6 URLs, curl requires --globoff to be passed in the arguments. Since novaclient does not use curl directly, this patch displays the curl commands with globoff option which works for both IPv4 and IPv6 URLs. Closes-Bug: #1228744 Change-Id: Ib7099e8e3bbc15f29bbaa1db37ef21e78a74e7bc
This commit is contained in:
parent
252cd0819a
commit
e91d469704
@ -317,7 +317,7 @@ class HTTPClient(object):
|
|||||||
if not self.http_log_debug:
|
if not self.http_log_debug:
|
||||||
return
|
return
|
||||||
|
|
||||||
string_parts = ['curl -i']
|
string_parts = ['curl -g -i']
|
||||||
|
|
||||||
if not kwargs.get('verify', True):
|
if not kwargs.get('verify', True):
|
||||||
string_parts.append(' --insecure')
|
string_parts.append(' --insecure')
|
||||||
|
@ -104,7 +104,7 @@ class HTTPClient(object):
|
|||||||
return
|
return
|
||||||
|
|
||||||
string_parts = [
|
string_parts = [
|
||||||
"curl -i",
|
"curl -g -i",
|
||||||
"-X '%s'" % method,
|
"-X '%s'" % method,
|
||||||
"'%s'" % url,
|
"'%s'" % url,
|
||||||
]
|
]
|
||||||
|
@ -376,18 +376,18 @@ class ClientTest(utils.TestCase):
|
|||||||
|
|
||||||
output = self.logger.output.split('\n')
|
output = self.logger.output.split('\n')
|
||||||
|
|
||||||
self.assertIn("REQ: curl -i '/foo' -X GET", output)
|
self.assertIn("REQ: curl -g -i '/foo' -X GET", output)
|
||||||
self.assertIn(
|
self.assertIn(
|
||||||
"REQ: curl -i '/foo' -X GET -H "
|
"REQ: curl -g -i '/foo' -X GET -H "
|
||||||
'"X-Auth-Token: {SHA1}b42162b6ffdbd7c3c37b7c95b7ba9f51dda0236d"',
|
'"X-Auth-Token: {SHA1}b42162b6ffdbd7c3c37b7c95b7ba9f51dda0236d"',
|
||||||
output)
|
output)
|
||||||
self.assertIn(
|
self.assertIn(
|
||||||
"REQ: curl -i '/foo' -X GET -H "
|
"REQ: curl -g -i '/foo' -X GET -H "
|
||||||
'"X-Auth-Token: {SHA1}b42162b6ffdbd7c3c37b7c95b7ba9f51dda0236d"'
|
'"X-Auth-Token: {SHA1}b42162b6ffdbd7c3c37b7c95b7ba9f51dda0236d"'
|
||||||
' -H "X-Foo: bar"',
|
' -H "X-Foo: bar"',
|
||||||
output)
|
output)
|
||||||
self.assertIn(
|
self.assertIn(
|
||||||
"REQ: curl -i '/foo' -X GET -d "
|
"REQ: curl -g -i '/foo' -X GET -d "
|
||||||
'\'{"auth": {"passwordCredentials": {"password":'
|
'\'{"auth": {"passwordCredentials": {"password":'
|
||||||
' "{SHA1}4fc49c6a671ce889078ff6b250f7066cf6d2ada2"}}}\'',
|
' "{SHA1}4fc49c6a671ce889078ff6b250f7066cf6d2ada2"}}}\'',
|
||||||
output)
|
output)
|
||||||
|
Loading…
Reference in New Issue
Block a user