aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2014-05-23 20:51:53 +0300
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2014-05-23 20:51:53 +0300
commit44580dc20dafccde7eddbd37db63a628d5a8661c (patch)
tree6e1b1c0364c5b2997ea44dcd0b8c299071b7c442
parentc2fb59c8dfbfa428bed05340d77ca745d43501ff (diff)
downloadlinaro-aws-tools-44580dc20dafccde7eddbd37db63a628d5a8661c.tar.gz
linaro-ami: Handle "init_script" config param more flexibly.
Don't assume it's shell script; don't assume it's relative path. This is useful to use for example /bin/true while debugging.
-rw-r--r--linaro-ami/linaro_ami.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/linaro-ami/linaro_ami.py b/linaro-ami/linaro_ami.py
index c0840b7..76c92a9 100644
--- a/linaro-ami/linaro_ami.py
+++ b/linaro-ami/linaro_ami.py
@@ -92,8 +92,9 @@ class LinaroAMI:
fetch_command_output = self.executor.execute(script_fetch + " slave-init")
self.log.debug(fetch_command_output)
- script_command = "sudo bash slave-init/" + self.config.get(
- ami_name, "init_script")
+ init_script_path = os.path.join("slave-init/", self.config.get(
+ ami_name, "init_script"))
+ script_command = "sudo " + init_script_path
self.log.info("Executing slave init script: " + \
script_command)
script_command_output = self.executor.execute(script_command)