No more guessing the URL!
Signed-off-by: John Spray <john.spray@redhat.com>
import sys
import time
import threading
+import socket
import cherrypy
import jinja2
osdmap = self.get_osdmap()
log.info("latest osdmap is %d" % osdmap.get_epoch())
+ # Publish the URI that others may use to access the service we're
+ # about to start serving
+ self.set_uri("http://{0}:{1}/".format(
+ socket.gethostname() if server_addr == "::" else server_addr,
+ server_port
+ ))
+
static_dir = os.path.join(current_dir, 'static')
conf = {
"/static": {
import tempfile
import threading
import traceback
+import socket
import common
if not os.path.isfile(pkey_fname):
raise CannotServe('private key %s does not exist' % pkey_fname)
+ # Publish the URI that others may use to access the service we're
+ # about to start serving
+ self.set_uri("https://{0}:{1}/".format(
+ socket.gethostname() if server_addr == "::" else server_addr,
+ server_port
+ ))
+
# Create the HTTPS werkzeug server serving pecan app
self.server = make_server(
host=server_addr,