summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorJhon Honce <jhonce@redhat.com>2015-03-23 09:15:08 -0700
committerJhon Honce <jhonce@redhat.com>2015-03-24 11:26:30 -0700
commit557cc0ca9ecc22a9d90f9cf9ce549186fe286492 (patch)
tree01cbd6a151e81400ba972fe7b593625007762fae /bin
parent8b68846806d5294b5f43d14772d59aa2b8cf5e73 (diff)
downloadopenshift-557cc0ca9ecc22a9d90f9cf9ce549186fe286492.tar.gz
openshift-557cc0ca9ecc22a9d90f9cf9ce549186fe286492.tar.bz2
openshift-557cc0ca9ecc22a9d90f9cf9ce549186fe286492.tar.xz
openshift-557cc0ca9ecc22a9d90f9cf9ce549186fe286492.zip
* Updates from code reviews
Diffstat (limited to 'bin')
-rwxr-xr-xbin/cluster14
1 files changed, 11 insertions, 3 deletions
diff --git a/bin/cluster b/bin/cluster
index af908155c..823f50671 100755
--- a/bin/cluster
+++ b/bin/cluster
@@ -83,9 +83,10 @@ class Cluster(object):
sys.stderr.write('RUN [{}]\n'.format(command))
sys.stderr.flush()
- error = os.system(command)
- if error != 0:
- raise Exception("Ansible run failed with exit code %d".format(error))
+ status = os.system(command)
+ if status != 0:
+ sys.stderr.write("RUN [{}] failed with exit status %d".format(command, status))
+ exit(status)
@@ -100,4 +101,11 @@ if __name__ == '__main__':
parser.add_argument('cluster_id', help='prefix for cluster VM names')
args = parser.parse_args()
+ if 'terminate' == args.action:
+ sys.stderr.write("This will terminate the ENTIRE {} environment. Are you sure? [y/N] ".format(args.cluster_id))
+ sys.stderr.flush()
+ answer = sys.stdin.read(1)
+ if answer not in ['y', 'Y']:
+ exit(0)
+
Cluster(args).apply()