def get_facts(self):
<EOL>vendor = u'<STR_LIT>'<EOL>uptime = -<NUM_LIT:1><EOL>serial_number, fqdn, os_version, hostname, domain_name = ('<STR_LIT>',) * <NUM_LIT:5><EOL>show_ver = self._send_command('<STR_LIT>')<EOL>show_hosts = self._send_command('<STR_LIT>')<EOL>show_ip_int_br = self._send_command('<STR_LIT>')<EOL>for line in show_ver.splitlines():<EOL><INDENT>if '<STR_LIT>' in line:<EOL><INDENT>hostname, uptime_str = line.split('<STR_LIT>')<EOL>uptime = self.parse_uptime(uptime_str)<EOL>hostname = hostname.strip()<EOL><DEDENT>if '<STR_LIT>' in line:<EOL><INDENT>_, serial_number = line.split("<STR_LIT>")<EOL>serial_number = serial_number.strip()<EOL><DEDENT>if re.search(r"<STR_LIT>", line):<EOL><INDENT>try:<EOL><INDENT>_, os_version = line.split("<STR_LIT>")<EOL><DEDENT>except ValueError:<EOL><INDENT>_, os_version = re.split(r"<STR_LIT>", line)<EOL><DEDENT>os_version = os_version.strip()<EOL><DEDENT>elif re.search(r"<STR_LIT>", line):<EOL><INDENT>_, os_version = line.split("<STR_LIT>")<EOL>os_version = os_version.strip()<EOL><DEDENT><DEDENT>for line in show_hosts.splitlines():<EOL><INDENT>if '<STR_LIT>' in line:<EOL><INDENT>_, domain_name = line.split("<STR_LIT>")<EOL>domain_name = domain_name.strip()<EOL>break<EOL><DEDENT><DEDENT>if domain_name != '<STR_LIT>' and hostname != '<STR_LIT>':<EOL><INDENT>fqdn = u'<STR_LIT>'.format(hostname, domain_name)<EOL><DEDENT>try:<EOL><INDENT>match_model = re.search(r"<STR_LIT>", show_ver, flags=re.IGNORECASE)<EOL>model = match_model.group(<NUM_LIT:1>)<EOL><DEDENT>except AttributeError:<EOL><INDENT>model = u'<STR_LIT>'<EOL><DEDENT>interface_list = []<EOL>show_ip_int_br = show_ip_int_br.strip()<EOL>for line in show_ip_int_br.splitlines():<EOL><INDENT>if '<STR_LIT>' in line:<EOL><INDENT>continue<EOL><DEDENT>interface = line.split()[<NUM_LIT:0>]<EOL>interface_list.append(interface)<EOL><DEDENT>return {<EOL>'<STR_LIT>': uptime,<EOL>'<STR_LIT>': vendor,<EOL>'<STR_LIT>': py23_compat.text_type(os_version),<EOL>'<STR_LIT>': py23_compat.text_type(serial_number),<EOL>'<STR_LIT>': py23_compat.text_type(model),<EOL>'<STR_LIT>': py23_compat.text_type(hostname),<EOL>'<STR_LIT>': fqdn,<EOL>'<STR_LIT>': interface_list<EOL>}<EOL>
Return a set of facts from the devices.