Skip to content
Snippets Groups Projects
Commit 394c7244 authored by Kipp Cannon's avatar Kipp Cannon
Browse files

httpinterface: service advertisement is not optional

parent 7ff9812d
No related branches found
No related tags found
No related merge requests found
......@@ -120,21 +120,15 @@ class HTTPServers(list):
httpd = HTTPDServer(host, port, bottle_app, verbose = verbose).__enter__()
if verbose:
print >>sys.stderr, "advertising http server \"%s\" on http://%s:%d ..." % (service_name, httpd.host, httpd.port),
service = None # in case what follows fails
try:
service = self.service_publisher.add_service(
sname = service_name,
sdomain = service_domain,
port = httpd.port,
properties = service_properties,
commit = False
)
except Exception as e:
if verbose:
print >>sys.stderr, "failed: %s" % str(e)
else:
if verbose:
print >>sys.stderr, "done (%s)" % ".".join((service.sname, service.sdomain))
service = self.service_publisher.add_service(
sname = service_name,
sdomain = service_domain,
port = httpd.port,
properties = service_properties,
commit = False
)
if verbose:
print >>sys.stderr, "done (%s)" % ".".join((service.sname, service.sdomain))
self.append((httpd, service))
if not self:
raise ValueError("unable to start servers%s" % (" on port %d" % port if port != 0 else ""))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment