summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorLénaïc Huard <lhuard@amadeus.com>2015-06-22 17:16:07 +0200
committerLénaïc Huard <lhuard@amadeus.com>2015-06-22 17:16:07 +0200
commit519c6ac8eeeed9d2438c1cc705fbf49f0ad75fdf (patch)
treeb9feecbddecbe1f1e63f082064077b47f9f889cd /bin
parenta7ac3f7b513fe57ddccad15bdb6c7e9091f16bcd (diff)
downloadopenshift-519c6ac8eeeed9d2438c1cc705fbf49f0ad75fdf.tar.gz
openshift-519c6ac8eeeed9d2438c1cc705fbf49f0ad75fdf.tar.bz2
openshift-519c6ac8eeeed9d2438c1cc705fbf49f0ad75fdf.tar.xz
openshift-519c6ac8eeeed9d2438c1cc705fbf49f0ad75fdf.zip
Add a --profile option to spot which task takes more time
Diffstat (limited to 'bin')
-rwxr-xr-xbin/cluster6
1 files changed, 6 insertions, 0 deletions
diff --git a/bin/cluster b/bin/cluster
index 2ea389523..954322482 100755
--- a/bin/cluster
+++ b/bin/cluster
@@ -178,6 +178,9 @@ class Cluster(object):
verbose, inventory, ansible_env, playbook
)
+ if args.profile:
+ command = 'ANSIBLE_CALLBACK_PLUGINS=ansible-profile/callback_plugins ' + command
+
if args.verbose > 1:
command = 'time {}'.format(command)
@@ -234,6 +237,9 @@ if __name__ == '__main__':
meta_parser.add_argument('-o', '--option', action='append',
help='options')
+ meta_parser.add_argument('-p', '--profile', action='store_true',
+ help='Enable playbook profiling')
+
action_parser = parser.add_subparsers(dest='action', title='actions',
description='Choose from valid actions')