summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarshan N <dnarayan@redhat.com>2015-08-05 18:00:28 +0530
committerSahina Bose <sabose@redhat.com>2015-08-16 22:58:00 -0700
commitd3b772cfc6b9e4442988540447a003e3ce4410e3 (patch)
tree111002cc18efd7fe4bacb4be3d48214f8f2425a7
parentd040cb45469d64fa7534247f9568b48b28114c3f (diff)
server-addons: pep8 fixes.
Change-Id: I920ed33f0e257dd741d1c6df39b46efebe9abd02 Signed-off-by: Darshan N <dnarayan@redhat.com> Reviewed-on: http://review.gluster.org/11836 Reviewed-by: Sahina Bose <sabose@redhat.com>
-rwxr-xr-xplugins/check_vol_server.py14
-rwxr-xr-xplugins/discovery.py2
-rw-r--r--plugins/network_utils.py2
-rw-r--r--tests/test_network_utils.py2
4 files changed, 10 insertions, 10 deletions
diff --git a/plugins/check_vol_server.py b/plugins/check_vol_server.py
index a45a24d..ba2a88a 100755
--- a/plugins/check_vol_server.py
+++ b/plugins/check_vol_server.py
@@ -16,7 +16,7 @@ def _getListHosts(hostgroup):
"GET hostgroups\nColumns: members_with_state\n"
"Filter: name = " + hostgroup + "\n"))[0][0]
# Get the only those nodes which are UP and
- #glusterd service is running
+ # glusterd service is running
for row in table:
if row[1] == utils.HostStatusCode.UP and \
_getGlusterdStatus(row[0]) \
@@ -243,13 +243,13 @@ def _executeRandomHost(hostgroup, command):
if status != utils.PluginStatusCode.UNKNOWN:
return status, output
- #random host is not able to execute the command
- #Now try to iterate through the list of hosts
- #in the host group and send the command until
- #the command is successful
+ # random host is not able to execute the command
+ # Now try to iterate through the list of hosts
+ # in the host group and send the command until
+ # the command is successful
- #No need to send it to host which we already sent unless volume locked
- if not "UNKNOWN: temporary error" in output:
+ # No need to send it to host which we already sent unless volume locked
+ if "UNKNOWN: temporary error" not in output:
# if volume locked,we can try on same host
list_hosts.remove(host)
for host in list_hosts:
diff --git a/plugins/discovery.py b/plugins/discovery.py
index b17c81f..c4fa149 100755
--- a/plugins/discovery.py
+++ b/plugins/discovery.py
@@ -568,7 +568,7 @@ if __name__ == '__main__':
args.nagiosServerIP, args.mode, args.timeout)
print "Cluster configurations synced successfully from host %s" % \
(args.hostip)
- #Unregister the temp_node1
+ # Unregister the temp_node1
unRegisterHost("temp_node1")
# If Nagios is running then try to restart. Otherwise don't do
# anything.
diff --git a/plugins/network_utils.py b/plugins/network_utils.py
index 83fecc0..0566aaf 100644
--- a/plugins/network_utils.py
+++ b/plugins/network_utils.py
@@ -65,7 +65,7 @@ def validateHostAddress(address):
return "Please specify host Address"
if IPADDR_RE.match(address):
- if not address in getNonLoopbackAddresses():
+ if address not in getNonLoopbackAddresses():
return "Address '%s' can't be mapped to non loopback devices " \
"on this host" % address
else:
diff --git a/tests/test_network_utils.py b/tests/test_network_utils.py
index f379e0c..7619cb3 100644
--- a/tests/test_network_utils.py
+++ b/tests/test_network_utils.py
@@ -48,7 +48,7 @@ class TestNetworkUtils(TestCaseBase):
network_utils.ethtool.get_ipaddr = self.mockGetIpAddr
network_utils.socket.gethostbyname_ex = self.mockGethostbyname_ex
- #Methods to test validateHostAddress(address)
+ # Methods to test validateHostAddress(address)
def testValidateHostAddressWithEmptyAddress(self):
self.setUpMocks()
validationMsg = network_utils.validateHostAddress(None)