Revision 1a8337f2 lib/http/client.py
b/lib/http/client.py | ||
---|---|---|
28 | 28 |
|
29 | 29 |
from ganeti import http |
30 | 30 |
from ganeti import compat |
31 |
from ganeti import netutils |
|
31 | 32 |
|
32 | 33 |
|
33 | 34 |
class HttpClientRequest(object): |
... | ... | |
104 | 105 |
"""Returns the full URL for this requests. |
105 | 106 |
|
106 | 107 |
""" |
108 |
if netutils.IPAddress.IsValid(self.host): |
|
109 |
family = netutils.IPAddress.GetAddressFamily(self.host) |
|
110 |
address = netutils.FormatAddress(family, (self.host, self.port)) |
|
111 |
else: |
|
112 |
address = "%s:%s" % (self.host, self.port) |
|
107 | 113 |
# TODO: Support for non-SSL requests |
108 |
return "https://%s:%s%s" % (self.host, self.port, self.path)
|
|
114 |
return "https://%s%s" % (address, self.path)
|
|
109 | 115 |
|
110 | 116 |
@property |
111 | 117 |
def identity(self): |
Also available in: Unified diff