{"action":"created","issue":{"url":"https://api.github.com/repos/napalm-automation/napalm-junos/issues/24","repository_url":"https://api.github.com/repos/napalm-automation/napalm-junos","labels_url":"https://api.github.com/repos/napalm-automation/napalm-junos/issues/24/labels{/name}","comments_url":"https://api.github.com/repos/napalm-automation/napalm-junos/issues/24/comments","events_url":"https://api.github.com/repos/napalm-automation/napalm-junos/issues/24/events","html_url":"https://github.com/napalm-automation/napalm-junos/issues/24","id":156119587,"number":24,"title":"get_facts() junos TypeError","user":{"login":"stiltzkin10","id":9121704,"avatar_url":"https://avatars.githubusercontent.com/u/9121704?v=3","gravatar_id":"","url":"https://api.github.com/users/stiltzkin10","html_url":"https://github.com/stiltzkin10","followers_url":"https://api.github.com/users/stiltzkin10/followers","following_url":"https://api.github.com/users/stiltzkin10/following{/other_user}","gists_url":"https://api.github.com/users/stiltzkin10/gists{/gist_id}","starred_url":"https://api.github.com/users/stiltzkin10/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stiltzkin10/subscriptions","organizations_url":"https://api.github.com/users/stiltzkin10/orgs","repos_url":"https://api.github.com/users/stiltzkin10/repos","events_url":"https://api.github.com/users/stiltzkin10/events{/privacy}","received_events_url":"https://api.github.com/users/stiltzkin10/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-05-21T20:15:07Z","updated_at":"2016-05-22T12:00:58Z","closed_at":null,"body":"I get a TypeError when I do a get_facts() on a virtual JUNOS router. I included the get_interfaces() call to show that NAPALM is able to talk to the router. It's just that get_facts() fails.\r\n\r\n$ python\r\nPython 2.7.11+ (default, Apr 17 2016, 14:00:29) \r\n[GCC 5.3.1 20160413] on linux2\r\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\r\n>>> from napalm import get_network_driver\r\n>>> driver = get_network_driver('junos')\r\n>>> device = driver('10.1.1.99', 'config_pusher', 'xxxxxxxxx')\r\n>>> device.open()\r\n>>> for i in device.get_interfaces():\r\n...   i\r\n... \r\n'demux0'\r\n'pime'\r\n...\r\n'em0'\r\n'pp0'\r\n'dsc'\r\n>>> device.get_facts()\r\nTraceback (most recent call last):\r\n  File \"<stdin>\", line 1, in <module>\r\n  File \"/usr/local/lib/python2.7/dist-packages/napalm_junos/junos.py\", line 163, in get_facts\r\n    'uptime': string_parsers.convert_uptime_string_seconds(uptime),\r\n  File \"/usr/local/lib/python2.7/dist-packages/napalm_base/utils/string_parsers.py\", line 75, in convert_uptime_string_seconds\r\n    uptime_dict = regex.search(uptime)\r\nTypeError: expected string or buffer\r\n\r\n**NAPALM:**\r\n$ pip show napalm\r\n---\r\nMetadata-Version: 1.1\r\nName: napalm\r\nVersion: 1.1.0\r\nSummary: Network Automation and Programmability Abstraction Layer with Multivendor support\r\nHome-page: https://github.com/napalm-automation/napalm\r\nAuthor: David Barroso\r\nAuthor-email: dbarrosop@dravetech.com\r\nLicense: UNKNOWN\r\nLocation: /usr/local/lib/python2.7/dist-packages\r\nRequires: napalm-base, napalm-eos, napalm-fortios, napalm-ibm, napalm-ios, napalm-iosxr, napalm-junos, napalm-nxos, napalm-pluribus, napalm-panos\r\nClassifiers:\r\n  Topic :: Utilities\r\n  Programming Language :: Python\r\n  Programming Language :: Python :: 2\r\n  Programming Language :: Python :: 2.7\r\n  Operating System :: POSIX :: Linux\r\n  Operating System :: MacOS\r\n\r\n**$ uname -a**\r\nLinux userver 4.4.0-22-generic #40-Ubuntu SMP Thu May 12 22:03:46 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux\r\n\r\n**JUNOS router:**\r\nconfig_pusher@J99> show version \r\nHostname: J99\r\nModel: olive\r\nJUNOS Base OS boot [12.1R1.9]\r\nJUNOS Base OS Software Suite [12.1R1.9]\r\nJUNOS Kernel Software Suite [12.1R1.9]\r\nJUNOS Crypto Software Suite [12.1R1.9]\r\nJUNOS Packet Forwarding Engine Support (M/T Common) [12.1R1.9]\r\nJUNOS Packet Forwarding Engine Support (M20/M40) [12.1R1.9]\r\nJUNOS Online Documentation [12.1R1.9]\r\nJUNOS Voice Services Container package [12.1R1.9]\r\nJUNOS Border Gateway Function package [12.1R1.9]\r\nJUNOS Services AACL Container package [12.1R1.9]\r\nJUNOS Services LL-PDF Container package [12.1R1.9]\r\nJUNOS Services PTSP Container package [12.1R1.9]\r\nJUNOS Services Stateful Firewall [12.1R1.9]\r\nJUNOS Services NAT [12.1R1.9]\r\nJUNOS Services Application Level Gateways [12.1R1.9]\r\nJUNOS Services Captive Portal and Content Delivery Container package [12.1R1.9]\r\nJUNOS Services RPM [12.1R1.9]\r\nJUNOS Services HTTP Content Management package [12.1R1.9]\r\nJUNOS AppId Services [12.1R1.9]\r\nJUNOS IDP Services [12.1R1.9]\r\nJUNOS Services Crypto [12.1R1.9]\r\nJUNOS Services SSL [12.1R1.9]\r\nJUNOS Services IPSec [12.1R1.9]\r\nJUNOS Runtime Software Suite [12.1R1.9]\r\nJUNOS Routing Software Suite [12.1R1.9]\r\n"},"comment":{"url":"https://api.github.com/repos/napalm-automation/napalm-junos/issues/comments/220828670","html_url":"https://github.com/napalm-automation/napalm-junos/issues/24#issuecomment-220828670","issue_url":"https://api.github.com/repos/napalm-automation/napalm-junos/issues/24","id":220828670,"user":{"login":"stiltzkin10","id":9121704,"avatar_url":"https://avatars.githubusercontent.com/u/9121704?v=3","gravatar_id":"","url":"https://api.github.com/users/stiltzkin10","html_url":"https://github.com/stiltzkin10","followers_url":"https://api.github.com/users/stiltzkin10/followers","following_url":"https://api.github.com/users/stiltzkin10/following{/other_user}","gists_url":"https://api.github.com/users/stiltzkin10/gists{/gist_id}","starred_url":"https://api.github.com/users/stiltzkin10/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stiltzkin10/subscriptions","organizations_url":"https://api.github.com/users/stiltzkin10/orgs","repos_url":"https://api.github.com/users/stiltzkin10/repos","events_url":"https://api.github.com/users/stiltzkin10/events{/privacy}","received_events_url":"https://api.github.com/users/stiltzkin10/received_events","type":"User","site_admin":false},"created_at":"2016-05-22T12:00:58Z","updated_at":"2016-05-22T12:00:58Z","body":"```\r\nfrom napalm import get_network_driver\r\ndriver = get_network_driver('junos')\r\ndevice = driver('10.1.1.99', 'config_pusher', 'EbXT8H5n')\r\ndevice.open()\r\nprint(device.device.facts)\r\n{'domain': None, 'serialnumber': '', 'ifd_style': 'CLASSIC', 'version_info': junos.version_info(major=(12, 1), type=R, minor=1, build=9), '2RE': False, 'hostname': 'J99', 'fqdn': 'J99', 'switch_style': 'NONE', 'version': '12.1R1.9', 'HOME': '/var/home/config_pusher', 'model': 'olive', 'vc_capable': False, 'personality': 'UNKNOWN'} \r\n```\r\n"}}
{"actor":{"display_login":"stiltzkin10"}}