aboutsummaryrefslogtreecommitdiff
path: root/node/prepare_build_config.py
diff options
context:
space:
mode:
Diffstat (limited to 'node/prepare_build_config.py')
-rwxr-xr-xnode/prepare_build_config.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/node/prepare_build_config.py b/node/prepare_build_config.py
index dfcde19..9fdee1c 100755
--- a/node/prepare_build_config.py
+++ b/node/prepare_build_config.py
@@ -30,11 +30,13 @@ def shell_unquote(s):
return s[1:-1]
return s
+def is_on_ec2():
+ return os.path.exists("/etc/cloud/cloud.cfg")
def get_slave_type():
slave_type = ""
try:
- if os.path.exists(SLAVE_TYPE_FILE_EC2):
+ if is_on_ec2():
f = open(SLAVE_TYPE_FILE_EC2)
else:
f = open(SLAVE_TYPE_FILE_VPS)
@@ -106,7 +108,7 @@ def convert_config_to_shell(config_text, out_filename):
def main(config_in, is_base64):
if is_base64:
config_in = base64.b64decode(config_in)
- if os.path.exists(BUILD_CONFIG_FILE_EC2):
+ if is_on_ec2():
BUILD_CONFIG_FILE=BUILD_CONFIG_FILE_EC2
else:
BUILD_CONFIG_FILE=BUILD_CONFIG_FILE_VPS