aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSander Vrijders <sander.vrijders@ugent.be>2018-06-07 12:38:10 +0200
committerSander Vrijders <sander.vrijders@ugent.be>2018-06-07 13:40:01 +0200
commit1f08ae1059c4878d96608c7ef3217732963058d4 (patch)
tree775c19439a93de2cf94aa6edd01a53ad78bb1eae
parent4716a3dfca1ef800668797eaea5cbc25fc59fd30 (diff)
downloadrumba-1f08ae1059c4878d96608c7ef3217732963058d4.tar.gz
rumba-1f08ae1059c4878d96608c7ef3217732963058d4.zip
prototypes: Fix bad layer names
This fixes the layer names, since 'DIF X' was being passed instead of just 'X'. It also adds a bash command to startup.sh so that it is always executed as a bash script.
-rw-r--r--rumba/prototypes/ouroboros.py14
-rw-r--r--rumba/storyboard.py7
2 files changed, 11 insertions, 10 deletions
diff --git a/rumba/prototypes/ouroboros.py b/rumba/prototypes/ouroboros.py
index 1c24a0c..022c931 100644
--- a/rumba/prototypes/ouroboros.py
+++ b/rumba/prototypes/ouroboros.py
@@ -56,25 +56,25 @@ class OurServer(sb.Server):
server.difs
)
- def _make_run_cmd(self):
- o_cmd = super(OurServer, self)._make_run_cmd()
+ def _make_run_cmd(self, node):
+ o_cmd = super(OurServer, self)._make_run_cmd(node)
# Run and store PID
- n_cmd = 'pid=$(%s); ' % (o_cmd,)
+ n_cmd = 'pid=$(%s) && ' % (o_cmd,)
# Build register command
r_cmd = 'irm r n %s ' % (self.id,)
if len(self.difs) == 0:
- r_cmd += 'layer \'*\''
+ r_cmd += ' '.join('layer %s' % (layer.name,) for layer in node.difs)
else:
- r_cmd += ' '.join('layer %s' % (layer,) for layer in self.difs)
- r_cmd += ' > /dev/null 2>&1; '
+ r_cmd += ' '.join('layer %s' % (layer.name,) for layer in self.difs)
+ r_cmd += ' && '
# Add register command
n_cmd += r_cmd
# Add bind command
- n_cmd += 'irm b process $pid name %s > /dev/null 2>&1; ' % (self.id,)
+ n_cmd += 'irm b process $pid name %s && ' % (self.id,)
n_cmd += 'echo $pid' # We need to return the pid for the sb
diff --git a/rumba/storyboard.py b/rumba/storyboard.py
index ecd639d..f03a2e8 100644
--- a/rumba/storyboard.py
+++ b/rumba/storyboard.py
@@ -486,7 +486,7 @@ class Server(_SBEntity):
proc_id=p
)
- def _make_run_cmd(self):
+ def _make_run_cmd(self, node):
run_cmd = self.ap + (
(" " + self.options) if self.options is not None else ""
)
@@ -496,7 +496,7 @@ class Server(_SBEntity):
"""Starts this server"""
for node in self.nodes:
- cmd = self._make_run_cmd()
+ cmd = self._make_run_cmd(node)
logger.debug(
'Starting server %s on node %s.',
@@ -1000,7 +1000,8 @@ class StoryBoard(_SBEntity):
for node in self.node_map.values():
_execute_command(
node,
- "echo '%s' > startup.sh && chmod a+x startup.sh" % (script,)
+ "echo '#!/usr/bin/env bash' > startup.sh; "
+ "echo '%s' >> startup.sh && chmod a+x startup.sh" % (script,)
)
try:
for server in self.server_apps.values():