Commit 9accbfe2 authored by Jérome Perrin's avatar Jérome Perrin

runner: support instance_name parameter (to be displayed in title)

parent 7631850a
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
{% block head %} {% block head %}
<meta http-equiv="content-type" content="text/html; charset=utf-8" /> <meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>SlapOS Buildout web runner</title> <title>{{ session.title }} - SlapOS Buildout web runner</title>
<meta name="keywords" content="" /> <meta name="keywords" content="" />
......
...@@ -623,11 +623,15 @@ def checkSoftwareFolder(path, config): ...@@ -623,11 +623,15 @@ def checkSoftwareFolder(path, config):
def getProjectTitle(config): def getProjectTitle(config):
"""Generate the name of the current software Release (for slaprunner UI)""" """Generate the name of the current software Release (for slaprunner UI)"""
conf = os.path.join(config['etc_dir'], ".project") conf = os.path.join(config['etc_dir'], ".project")
# instance_name is optional parameter
instance_name = config.get('instance_name')
if instance_name:
instance_name = '%s - ' % instance_name
if os.path.exists(conf): if os.path.exists(conf):
project = open(conf, "r").read().split("/") project = open(conf, "r").read().split("/")
software = project[-2] software = project[-2]
return '%s (%s)' % (software, '/'.join(project[:-2])) return '%s%s (%s)' % (instance_name, software, '/'.join(project[:-2]))
return "No Profile" return "%sNo Profile" % instance_name
def getSoftwareReleaseName(config): def getSoftwareReleaseName(config):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment