From: Tony Mack Date: Tue, 19 Oct 2010 17:46:45 +0000 (-0400) Subject: fix positon of port number when generating interface url X-Git-Tag: sfa-1.0-5~3 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=0bb4d5593e4736ecb2c2dd4162a8feeaa2ef6f38;hp=59c2ee6282736e99f9519589df226cbff8df2b0a;p=sfa.git fix positon of port number when generating interface url --- diff --git a/sfa/server/interface.py b/sfa/server/interface.py index 0804fc1d..e923057f 100644 --- a/sfa/server/interface.py +++ b/sfa/server/interface.py @@ -60,8 +60,12 @@ class Interfaces(dict): interfaces = [self.interfaces] # set the url and urn for interface in interfaces: + # port is appended onto the domain, before the path. Should look like: + # http://domain:port/path hrn, address, port = interface['hrn'], interface['addr'], interface['port'] - url = 'http://%(address)s:%(port)s' % locals() + address_parts = address.split('/') + address_parts[0] = address_parts[0] + ":" + str(port) + url = "http://%s" % "/".join(address_parts) interface['url'] = url interface['urn'] = hrn_to_urn(hrn, 'authority')