def get_facts(self):
<EOL>vendor = "<STR_LIT>"<EOL>uptime = -<NUM_LIT:1><EOL>serial_number, fqdn, os_version, hostname, domain_name, model = ("<STR_LIT>",) * <NUM_LIT:6><EOL>show_ver = self._send_command("<STR_LIT>")<EOL>show_hosts = self._send_command("<STR_LIT>")<EOL>show_int_status = self._send_command("<STR_LIT>")<EOL>show_hostname = self._send_command("<STR_LIT>")<EOL>for line in show_ver.splitlines():<EOL><INDENT>if "<STR_LIT>" in line:<EOL><INDENT>_, uptime_str = line.split("<STR_LIT>")<EOL>uptime = self.parse_uptime(uptime_str)<EOL><DEDENT>if "<STR_LIT>" in line:<EOL><INDENT>_, serial_number = line.split("<STR_LIT>")<EOL>serial_number = serial_number.strip()<EOL><DEDENT>if "<STR_LIT>" in line or "<STR_LIT>" in line:<EOL><INDENT>line = line.strip()<EOL>os_version = line.split()[<NUM_LIT:2>]<EOL>os_version = os_version.strip()<EOL><DEDENT>if "<STR_LIT>" in line and "<STR_LIT>" in line:<EOL><INDENT>match = re.search(r"<STR_LIT>", line)<EOL>if match:<EOL><INDENT>model = match.group(<NUM_LIT:1>).strip()<EOL><DEDENT>match = re.search(r"<STR_LIT>", line)<EOL>if match:<EOL><INDENT>model = match.group(<NUM_LIT:1>).strip()<EOL><DEDENT><DEDENT><DEDENT>hostname = show_hostname.strip()<EOL>for line in show_hosts.splitlines():<EOL><INDENT>if "<STR_LIT>" in line:<EOL><INDENT>_, domain_name = re.split(r"<STR_LIT>", line)<EOL>domain_name = domain_name.strip()<EOL>break<EOL><DEDENT><DEDENT>if hostname.count("<STR_LIT:.>") >= <NUM_LIT:2>:<EOL><INDENT>fqdn = hostname<EOL>if domain_name:<EOL><INDENT>hostname = re.sub(re.escape(domain_name) + "<STR_LIT:$>", "<STR_LIT>", hostname)<EOL>hostname = hostname.strip("<STR_LIT:.>")<EOL><DEDENT><DEDENT>elif domain_name:<EOL><INDENT>fqdn = "<STR_LIT>".format(hostname, domain_name)<EOL><DEDENT>interface_list = []<EOL>show_int_status = show_int_status.strip()<EOL>show_int_status = re.sub(<EOL>r"<STR_LIT>", "<STR_LIT>", show_int_status, flags=re.M<EOL>)<EOL>for line in show_int_status.splitlines():<EOL><INDENT>if not line:<EOL><INDENT>continue<EOL><DEDENT>interface = line.split()[<NUM_LIT:0>]<EOL>interface_list.append(helpers.canonical_interface_name(interface))<EOL><DEDENT>return {<EOL>"<STR_LIT>": int(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.