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:
sridhargaddam 2014-11-14 14:26:53 +00:00
parent 252cd0819a
commit e91d469704
3 changed files with 6 additions and 6 deletions

View File

@ -317,7 +317,7 @@ class HTTPClient(object):
if not self.http_log_debug:
return
string_parts = ['curl -i']
string_parts = ['curl -g -i']
if not kwargs.get('verify', True):
string_parts.append(' --insecure')

View File

@ -104,7 +104,7 @@ class HTTPClient(object):
return
string_parts = [
"curl -i",
"curl -g -i",
"-X '%s'" % method,
"'%s'" % url,
]

View File

@ -376,18 +376,18 @@ class ClientTest(utils.TestCase):
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(
"REQ: curl -i '/foo' -X GET -H "
"REQ: curl -g -i '/foo' -X GET -H "
'"X-Auth-Token: {SHA1}b42162b6ffdbd7c3c37b7c95b7ba9f51dda0236d"',
output)
self.assertIn(
"REQ: curl -i '/foo' -X GET -H "
"REQ: curl -g -i '/foo' -X GET -H "
'"X-Auth-Token: {SHA1}b42162b6ffdbd7c3c37b7c95b7ba9f51dda0236d"'
' -H "X-Foo: bar"',
output)
self.assertIn(
"REQ: curl -i '/foo' -X GET -d "
"REQ: curl -g -i '/foo' -X GET -d "
'\'{"auth": {"passwordCredentials": {"password":'
' "{SHA1}4fc49c6a671ce889078ff6b250f7066cf6d2ada2"}}}\'',
output)