summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Illfelder <illfelder@users.noreply.github.com>2016-06-23 13:29:40 -0700
committerGitHub <noreply@github.com>2016-06-23 13:29:40 -0700
commitda19af810ec7565e75322418f3acddaccef6dc1e (patch)
treeed0bd309c81a7f04d9a3d5ee5181847c2add009f
parent113360cd8829a850f7ad906d974d6a204938cc31 (diff)
downloadgoogle-compute-image-packages-da19af810ec7565e75322418f3acddaccef6dc1e.tar.gz
Update metadata scripts to default to bash. (#287)
-rw-r--r--google_compute_engine/metadata_scripts/script_executor.py4
-rw-r--r--google_compute_engine/metadata_scripts/tests/script_executor_test.py4
2 files changed, 4 insertions, 4 deletions
diff --git a/google_compute_engine/metadata_scripts/script_executor.py b/google_compute_engine/metadata_scripts/script_executor.py
index 1293833..d152d60 100644
--- a/google_compute_engine/metadata_scripts/script_executor.py
+++ b/google_compute_engine/metadata_scripts/script_executor.py
@@ -50,8 +50,8 @@ class ScriptExecutor(object):
metadata_script: string, the file location of an executable script.
"""
process = subprocess.Popen(
- metadata_script, shell=True, stderr=subprocess.STDOUT,
- stdout=subprocess.PIPE)
+ metadata_script, shell=True, executable='/bin/bash',
+ stderr=subprocess.STDOUT, stdout=subprocess.PIPE)
while True:
for line in iter(process.stdout.readline, b''):
message = line.decode('utf-8').rstrip('\n')
diff --git a/google_compute_engine/metadata_scripts/tests/script_executor_test.py b/google_compute_engine/metadata_scripts/tests/script_executor_test.py
index ffe8b99..84c66d4 100644
--- a/google_compute_engine/metadata_scripts/tests/script_executor_test.py
+++ b/google_compute_engine/metadata_scripts/tests/script_executor_test.py
@@ -62,8 +62,8 @@ class ScriptExecutorTest(unittest.TestCase):
]
self.assertEqual(self.mock_logger.info.mock_calls, expected_calls)
mock_subprocess.Popen.assert_called_once_with(
- self.metadata_script, shell=True, stderr=mock_subprocess.STDOUT,
- stdout=mock_subprocess.PIPE)
+ self.metadata_script, shell=True, executable='/bin/bash',
+ stderr=mock_subprocess.STDOUT, stdout=mock_subprocess.PIPE)
mock_process.poll.assert_called_once_with()
def testRunScripts(self):