added error passing
This commit is contained in:
1 parent
b60c9da8b0
commit
357629f180
1 file changed
+7
-1
@@ -37,7 +37,13 @@ def dig(inDomain, record):
|
|||||||
|
|
||||||
def ipLookup(inDomain):
|
def ipLookup(inDomain):
|
||||||
ipLook = subprocess.check_output(["geoiplookup", inDomain])
|
ipLook = subprocess.check_output(["geoiplookup", inDomain])
|
||||||
host = subprocess.check_call(["host", inDomain]) #Do exit status check...
|
try:
|
||||||
|
host = subprocess.check_output(["host", inDomain]) #Do exit status check...
|
||||||
|
returncode = 0
|
||||||
|
except CalledProcessError as e:
|
||||||
|
output = o.output
|
||||||
|
returncode = e.returncode
|
||||||
|
|
||||||
print ipLook, "PTR: ", host
|
print ipLook, "PTR: ", host
|
||||||
|
|
||||||
def getInput():
|
def getInput():
|
||||||
|
|||||||
Reference in new issue
Block a user