summaryrefslogtreecommitdiffstats
path: root/deploy/common.py
diff options
context:
space:
mode:
Diffstat (limited to 'deploy/common.py')
-rw-r--r--deploy/common.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/deploy/common.py b/deploy/common.py
index 80832e201..dab9602c5 100644
--- a/deploy/common.py
+++ b/deploy/common.py
@@ -57,7 +57,7 @@ def exec_cmd(cmd, check=True, attempts=1, delay=5, verbose=False, mask_args=[],
# a negative value means forever
while attempts != 0:
- attempts = attempts - 1
+ attempts -= 1
process = subprocess.Popen(cmd,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
@@ -74,13 +74,13 @@ def exec_cmd(cmd, check=True, attempts=1, delay=5, verbose=False, mask_args=[],
if check:
if return_code > 0:
stderr = stderr.strip()
- print "Failed command: " + str(masked_cmd)
- print "Command returned response: " + str(stderr)
- print "Command return code: " + str(return_code)
+ print("Failed command: " + str(masked_cmd))
+ print("Command returned response: " + str(stderr))
+ print("Command return code: " + str(return_code))
raise Exception(stderr)
else:
- print "Command: " + str(masked_cmd)
- print str(response)
+ print("Command: " + str(masked_cmd))
+ print(str(response))
return response
return response, return_code
@@ -140,7 +140,7 @@ def warn(message):
def check_file_exists(file_path):
if not os.path.dirname(file_path):
file_path = '%s/%s' % (CWD, file_path)
- if not os.path.isfile(file_path):
+ if not os.access(file_path, os.R_OK):
err('ERROR: File %s not found\n' % file_path)