ifxlookup/plugins/dns.py
Daniel Dayley 8ac4d52d5f More stuff, can't really remember
I need to finish up some of the F5 features but I'm starting on Aruba anyway
2019-12-09 15:23:44 -07:00

17 lines
598 B
Python

from servicebase import ServiceBase
class ServiceDelegate(ServiceBase) :
def get_arguments(cls) :
"""Returns an array of information used to construct an argumentparser argument."""
return [ '-d', '--dns', 'store_true', "Return DNS resolution about the subject" ]
def perform_lookup(self,host_tuple) :
return_dict = {}
if len(host_tuple[2]) > 0 :
return_dict['ipaddresses'] = list(host_tuple[2])
if host_tuple[0] and host_tuple[0] != '' :
return_dict['hostname'] = host_tuple[0]
if len(host_tuple[1]) > 0 :
return_dict['aliases'] = list(host_tuple[1])
return return_dict