From d3b772cfc6b9e4442988540447a003e3ce4410e3 Mon Sep 17 00:00:00 2001 From: Darshan N Date: Wed, 5 Aug 2015 18:00:28 +0530 Subject: server-addons: pep8 fixes. Change-Id: I920ed33f0e257dd741d1c6df39b46efebe9abd02 Signed-off-by: Darshan N Reviewed-on: http://review.gluster.org/11836 Reviewed-by: Sahina Bose --- plugins/check_vol_server.py | 14 +++++++------- plugins/discovery.py | 2 +- plugins/network_utils.py | 2 +- tests/test_network_utils.py | 2 +- 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) -- cgit