aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Moravec <pmoravec@redhat.com>2015-10-05 22:45:30 +0200
committerBryn M. Reeves <bmr@redhat.com>2015-10-15 12:07:09 +0100
commit06f3375a0f42e1d9194edcac0a770459480a84b6 (patch)
tree8c6385679618e546386227b07aa616c79e31cc4c
parent7f73883fc538f81306ca87e4e7bda89fd6554756 (diff)
downloadsos-06f3375a0f42e1d9194edcac0a770459480a84b6.tar.gz
[qpid_dispatch] code cleanup and adding authorship
Merged identical code into one loop iterating over ["ssl-certificate", "ssl-key", "ssl-trustfile"]. Added authorship. Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
-rw-r--r--sos/plugins/qpid_dispatch.py17
1 files changed, 8 insertions, 9 deletions
diff --git a/sos/plugins/qpid_dispatch.py b/sos/plugins/qpid_dispatch.py
index 8e6a0e0e..b742707c 100644
--- a/sos/plugins/qpid_dispatch.py
+++ b/sos/plugins/qpid_dispatch.py
@@ -1,3 +1,5 @@
+# Copyright (C) 2015 Red Hat, Inc., Pavel Moravec <pmoravec@redhat.com>
+
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
@@ -38,15 +40,12 @@ class QpidDispatch(Plugin, RedHatPlugin):
options = (options + " -b " + gethostname() +
":%s" % (self.get_option("port")))
# gethostname() is due to DISPATCH-156
- if self.get_option("ssl-certificate"):
- options = (options + " --ssl-certificate=" +
- self.get_option("ssl-certificate"))
- if self.get_option("ssl-key"):
- options = (options + " --ssl-key=" +
- self.get_option("ssl-key"))
- if self.get_option("ssl-trustfile"):
- options = (options + " --ssl-trustfile=" +
- self.get_option("ssl-trustfile"))
+
+ # for either present option, add --option=value to 'options' variable
+ for option in ["ssl-certificate", "ssl-key", "ssl-trustfile"]:
+ if self.get_option(option):
+ options = (options + " --%s=" % (option) +
+ self.get_option(option))
self.add_cmd_output([
"qdstat -a" + options, # Show Router Addresses