summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorThomas Wiest <twiest@users.noreply.github.com>2015-11-18 10:19:36 -0500
committerThomas Wiest <twiest@users.noreply.github.com>2015-11-18 10:19:36 -0500
commita969c104eb3ec019907df8f3039f2d4b91d52583 (patch)
treec2e584c48bca1b9e53ce674218021c422bea44bc /bin
parentdb7ad3c4a40b881401800bf7da08d0bf59cda814 (diff)
parent91d6a3495b10f64d4d95378a96a3125fa60541d6 (diff)
downloadopenshift-a969c104eb3ec019907df8f3039f2d4b91d52583.tar.gz
openshift-a969c104eb3ec019907df8f3039f2d4b91d52583.tar.bz2
openshift-a969c104eb3ec019907df8f3039f2d4b91d52583.tar.xz
openshift-a969c104eb3ec019907df8f3039f2d4b91d52583.zip
Merge pull request #927 from abutcher/formatFields
Use field numbers for each format in bin/cluster for python 2.6
Diffstat (limited to 'bin')
-rwxr-xr-xbin/cluster20
1 files changed, 10 insertions, 10 deletions
diff --git a/bin/cluster b/bin/cluster
index 220f11d49..a3d4b629c 100755
--- a/bin/cluster
+++ b/bin/cluster
@@ -163,7 +163,7 @@ class Cluster(object):
boto_configs = [conf for conf in boto_conf_files if conf_exists(conf)]
if len(key_missing) > 0 and len(boto_configs) == 0:
- raise ValueError("PROVIDER aws requires {} environment variable(s). See README_AWS.md".format(key_missing))
+ raise ValueError("PROVIDER aws requires {0} environment variable(s). See README_AWS.md".format(key_missing))
elif 'libvirt' == provider:
inventory = '-i inventory/libvirt/hosts'
@@ -171,7 +171,7 @@ class Cluster(object):
inventory = '-i inventory/openstack/hosts'
else:
# this code should never be reached
- raise ValueError("invalid PROVIDER {}".format(provider))
+ raise ValueError("invalid PROVIDER {0}".format(provider))
return inventory
@@ -186,18 +186,18 @@ class Cluster(object):
verbose = ''
if args.verbose > 0:
- verbose = '-{}'.format('v' * args.verbose)
+ verbose = '-{0}'.format('v' * args.verbose)
if args.option:
for opt in args.option:
k, v = opt.split('=', 1)
env['cli_' + k] = v
- ansible_env = '-e \'{}\''.format(
+ ansible_env = '-e \'{0}\''.format(
' '.join(['%s=%s' % (key, value) for (key, value) in env.items()])
)
- command = 'ansible-playbook {} {} {} {}'.format(
+ command = 'ansible-playbook {0} {1} {2} {3}'.format(
verbose, inventory, ansible_env, playbook
)
@@ -205,16 +205,16 @@ class Cluster(object):
command = 'ANSIBLE_CALLBACK_PLUGINS=ansible-profile/callback_plugins ' + command
if args.verbose > 1:
- command = 'time {}'.format(command)
+ command = 'time {0}'.format(command)
if args.verbose > 0:
- sys.stderr.write('RUN [{}]\n'.format(command))
+ sys.stderr.write('RUN [{0}]\n'.format(command))
sys.stderr.flush()
try:
subprocess.check_call(command, shell=True)
except subprocess.CalledProcessError as exc:
- raise ActionFailed("ACTION [{}] failed: {}"
+ raise ActionFailed("ACTION [{0}] failed: {1}"
.format(args.action, exc))
@@ -325,14 +325,14 @@ if __name__ == '__main__':
args = parser.parse_args()
if 'terminate' == args.action and not args.force:
- answer = raw_input("This will destroy the ENTIRE {} environment. Are you sure? [y/N] ".format(args.cluster_id))
+ answer = raw_input("This will destroy the ENTIRE {0} environment. Are you sure? [y/N] ".format(args.cluster_id))
if answer not in ['y', 'Y']:
sys.stderr.write('\nACTION [terminate] aborted by user!\n')
exit(1)
if 'update' == args.action and not args.force:
answer = raw_input(
- "This is destructive and could corrupt {} environment. Continue? [y/N] ".format(args.cluster_id))
+ "This is destructive and could corrupt {0} environment. Continue? [y/N] ".format(args.cluster_id))
if answer not in ['y', 'Y']:
sys.stderr.write('\nACTION [update] aborted by user!\n')
exit(1)