From 3a314b15582f6f3e93d6583e8be363030a78b341 Mon Sep 17 00:00:00 2001 From: Jason Burgett Date: Thu, 31 Aug 2017 04:35:51 +0000 Subject: [PATCH] Changed subprocess call from .check_output to .Popen to fix an error when finding the operating directory when running initial_setup.py. .check_output seemed to be having trouble when any exit status other than 0. --- initial_setup.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/initial_setup.py b/initial_setup.py index 4d967103..5b2d83cc 100644 --- a/initial_setup.py +++ b/initial_setup.py @@ -6,7 +6,9 @@ def update_config_paths(): - project_path = subprocess.check_output(['find', '/', '-name', 'GSbSFZwWV1mig4vFSmbLW9iP8TfGfMYCPfHTqGcD'])[:-42].decode('utf-8') + find_output = subprocess.Popen(['find', '/', '-name', 'GSbSFZwWV1mig4vFSmbLW9iP8TfGfMYCPfHTqGcD'], stdout=subprocess.PIPE) + project_path_raw, err = find_output.communicate() + project_path = str(project_path_raw.decode('utf-8'))[:-42] os.system('sudo cp -a Reset\ Device/static_files/rc.local.aphost.template Reset\ Device/static_files/rc.local.aphost') os.system('sudo cp -a Reset\ Device/static_files/rc.local.apclient.template Reset\ Device/static_files/rc.local.apclient')