{"action":"created","issue":{"url":"https://api.github.com/repos/napalm-automation/napalm/issues/687","repository_url":"https://api.github.com/repos/napalm-automation/napalm","labels_url":"https://api.github.com/repos/napalm-automation/napalm/issues/687/labels{/name}","comments_url":"https://api.github.com/repos/napalm-automation/napalm/issues/687/comments","events_url":"https://api.github.com/repos/napalm-automation/napalm/issues/687/events","html_url":"https://github.com/napalm-automation/napalm/issues/687","id":309617106,"number":687,"title":"OSError: Search pattern never detected in send_command_expect: [>##]\\s*$","user":{"login":"LongBeachHXC","id":31868262,"avatar_url":"https://avatars3.githubusercontent.com/u/31868262?v=4","gravatar_id":"","url":"https://api.github.com/users/LongBeachHXC","html_url":"https://github.com/LongBeachHXC","followers_url":"https://api.github.com/users/LongBeachHXC/followers","following_url":"https://api.github.com/users/LongBeachHXC/following{/other_user}","gists_url":"https://api.github.com/users/LongBeachHXC/gists{/gist_id}","starred_url":"https://api.github.com/users/LongBeachHXC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LongBeachHXC/subscriptions","organizations_url":"https://api.github.com/users/LongBeachHXC/orgs","repos_url":"https://api.github.com/users/LongBeachHXC/repos","events_url":"https://api.github.com/users/LongBeachHXC/events{/privacy}","received_events_url":"https://api.github.com/users/LongBeachHXC/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-29T04:37:27Z","updated_at":"2018-03-30T17:35:56Z","closed_at":null,"author_association":"NONE","body":"Is the below problem because a command that was sent down the channel produced a different output such as something like \"confirm\"?\r\n\r\nI ran into this error so I cut down all unnecessary commands from the templates I was referencing and I still encountered the same error. As a result, I rewrote my code to leverage Netmiko directly.\r\n\r\nThank you for any assistance. \r\n\r\n``` Python\r\n#!/usr/bin/env python\r\n\r\nfrom getpass import getpass\r\nfrom netmiko import ConnectHandler\r\nfrom netmiko.ssh_exception import NetMikoTimeoutException\r\nfrom paramiko.ssh_exception import SSHException\r\nfrom netmiko.ssh_exception import AuthenticationException\r\nfrom napalm import get_network_driver\r\n\r\nusername = input('Enter your SSH username: ')\r\npassword = getpass()\r\n\r\nwith open('devices_file') as f:\r\n    devices_list = f.read().splitlines()\r\n\r\nfor devices in devices_list:\r\n    print ('Connecting to device ' + devices)\r\n\r\n    driver = get_network_driver('ios')\r\n    device = driver(devices, username, password)\r\n    device.open()\r\n\r\n    device.load_merge_candidate(filename=devices + 'config_final.cfg')\r\n\r\n    diffs = device.compare_config()\r\n    if len(diffs) > 0:\r\n        print ('Committing Configuration Differences')\r\n        device.commit_config()\r\n    else:\r\n        print ('No Changes Required')\r\n        device.discard_config()\r\n\r\n    device.close()\r\n```\r\n\r\nTraceback (most recent call last):\r\n  File \"applyconfig.py\", line 28, in <module>\r\n    device.commit_config()\r\n  File \"/mnt/c/Users/forwein/linuxFileFolder/venv/westfield/wtc/interfacestandardPython3/lib/python3.6/site-packages/napalm/ios/ios.py\", line 458, in commit_config\r\n    output = self._commit_hostname_handler(cmd)\r\n  File \"/mnt/c/Users/forwein/linuxFileFolder/venv/westfield/wtc/interfacestandardPython3/lib/python3.6/site-packages/napalm/ios/ios.py\", line 393, in wrapper\r\n    retval = f(self, *args, **kwargs)\r\n  File \"/mnt/c/Users/forwein/linuxFileFolder/venv/westfield/wtc/interfacestandardPython3/lib/python3.6/site-packages/napalm/ios/ios.py\", line 418, in _commit_hostname_handler\r\n    output = self.device.send_command_expect(cmd, expect_string=pattern)\r\n  File \"/mnt/c/Users/forwein/linuxFileFolder/venv/westfield/wtc/interfacestandardPython3/lib/python3.6/site-packages/netmiko/base_connection.py\", line 1069, in send_command_expect\r\n    return self.send_command(*args, **kwargs)\r\n  File \"/mnt/c/Users/forwein/linuxFileFolder/venv/westfield/wtc/interfacestandardPython3/lib/python3.6/site-packages/netmiko/base_connection.py\", line 1051, in send_command\r\n    search_pattern))\r\nOSError: Search pattern never detected in send_command_expect: [>##]\\s*$"},"comment":{"url":"https://api.github.com/repos/napalm-automation/napalm/issues/comments/377578182","html_url":"https://github.com/napalm-automation/napalm/issues/687#issuecomment-377578182","issue_url":"https://api.github.com/repos/napalm-automation/napalm/issues/687","id":377578182,"user":{"login":"ktbyers","id":899716,"avatar_url":"https://avatars0.githubusercontent.com/u/899716?v=4","gravatar_id":"","url":"https://api.github.com/users/ktbyers","html_url":"https://github.com/ktbyers","followers_url":"https://api.github.com/users/ktbyers/followers","following_url":"https://api.github.com/users/ktbyers/following{/other_user}","gists_url":"https://api.github.com/users/ktbyers/gists{/gist_id}","starred_url":"https://api.github.com/users/ktbyers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ktbyers/subscriptions","organizations_url":"https://api.github.com/users/ktbyers/orgs","repos_url":"https://api.github.com/users/ktbyers/repos","events_url":"https://api.github.com/users/ktbyers/events{/privacy}","received_events_url":"https://api.github.com/users/ktbyers/received_events","type":"User","site_admin":false},"created_at":"2018-03-30T17:35:56Z","updated_at":"2018-03-30T17:35:56Z","author_association":"CONTRIBUTOR","body":"Make sure you are using the latest released version of Netmiko and of NAPALM.\r\n\r\nThen I would try:\r\n\r\n```\r\n    driver = get_network_driver('ios')\r\n    device = driver(devices, username, password, optional_args={'global_delay_factor': 2})\r\n    device.open()\r\n```\r\n\r\nTry adding the global_delay_factor (try both 2 and 4 for a value).\r\n"}}
{"actor":{"display_login":"ktbyers"}}