Improve return function
This commit is contained in:
@@ -33,7 +33,4 @@ def check_fqdn_ip(self):
|
||||
y = requests.get('http://v4.wordops.eu/dns/{0}/'.format(wo_fqdn))
|
||||
ip_fqdn = (y.text).strip()
|
||||
|
||||
if ip == ip_fqdn:
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
return bool(ip == ip_fqdn)
|
||||
|
||||
@@ -27,14 +27,9 @@ class WOShellExec():
|
||||
cmd_stderr_bytes.decode('utf-8',
|
||||
"replace"))
|
||||
|
||||
if proc.returncode == 0:
|
||||
Log.debug(self, "Command Output: {0}, \nCommand Error: {1}"
|
||||
.format(cmd_stdout, cmd_stderr))
|
||||
return True
|
||||
else:
|
||||
Log.debug(self, "Command Output: {0}, \nCommand Error: {1}"
|
||||
.format(cmd_stdout, cmd_stderr))
|
||||
return False
|
||||
Log.debug(self, "Command Output: {0}, \nCommand Error: {1}"
|
||||
.format(cmd_stdout, cmd_stderr))
|
||||
return bool(proc.returncode == 0)
|
||||
except OSError as e:
|
||||
Log.debug(self, str(e))
|
||||
raise CommandExecutionError
|
||||
|
||||
Reference in New Issue
Block a user