diff options
author | Gevorg Davoian <gdavoian@mirantis.com> | 2016-09-30 12:27:08 +0300 |
---|---|---|
committer | Gevorg Davoian <gdavoian@mirantis.com> | 2016-09-30 12:46:02 +0300 |
commit | e491573654d5fb84cb8539516fca1a69496a4dba (patch) | |
tree | fc4920da9470c6e3bf71b3732d425ac285033f27 /tools | |
parent | 16820d91b115717a12f0beb88d1ebc2c5c451b9e (diff) | |
download | oslo-messaging-e491573654d5fb84cb8539516fca1a69496a4dba.tar.gz |
Fix simulator bool command line args
--debug, --is-cast and --is-fanout are defined as args of type=bool.
This means that, for example, if we want to enable debug logging
level, we have to type '--debug True'. But we can also use
'--debug False' in order to do the same, which is very misleading
(in fact, any non-empty string will evaluate to True). This patch
tries to solve this problem by replacing type=bool and
default=False with action='store_true' for these args, so that
we will be able to enable them (they will remain False by default
as before) simply as '--debug' etc.
Change-Id: I8ee04c35427df446966161491da8d264b44975bf
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/simulator.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/tools/simulator.py b/tools/simulator.py index 8a3ff5a..c4c2308 100755 --- a/tools/simulator.py +++ b/tools/simulator.py @@ -601,8 +601,7 @@ def main(): parser.add_argument('--url', dest='url', default='rabbit://guest:password@localhost/', help="oslo.messaging transport url") - parser.add_argument('-d', '--debug', dest='debug', type=bool, - default=False, + parser.add_argument('-d', '--debug', dest='debug', action='store_true', help="Turn on DEBUG logging level instead of WARN") parser.add_argument('-tp', '--topic', dest='topic', default="profiler_topic", @@ -659,10 +658,10 @@ def main(): client.add_argument('--exit-wait', dest='exit_wait', type=int, default=0, help='Keep connections open N seconds after calls ' 'have been done') - client.add_argument('--is-cast', dest='is_cast', type=bool, default=False, + client.add_argument('--is-cast', dest='is_cast', action='store_true', help='Use `call` or `cast` RPC methods') - client.add_argument('--is-fanout', dest='is_fanout', type=bool, - default=False, help='fanout=True for CAST messages') + client.add_argument('--is-fanout', dest='is_fanout', action='store_true', + help='fanout=True for CAST messages') args = parser.parse_args() |