Skip to content

Commit

Permalink
sq-poller: Fix reference to undefined self.prompt in _ssh_connect
Browse files Browse the repository at this point in the history
_ssh_connect was refactored in PR netenglabs#877 and introduced a reference to self.prompt before prompt was defined.

This resulted in the error:
suzieq.poller.worker.nodes.node - ERROR - Unable to create persistent SSH session for 1.2.3.4 due to 'IosXENode' object has no attribute 'prompt'

Signed-off-by: Chris Bennett <[email protected]>
  • Loading branch information
cgb committed Mar 2, 2024
1 parent b22700e commit 0ff9edb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion suzieq/poller/worker/nodes/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -1679,7 +1679,6 @@ async def _rest_gather(self, service_callback, cmd_list, cb_token,

async def _fetch_init_dev_data_devtype(self, reconnect: bool):
"""Fill in the boot time of the node by executing certain cmds"""
self.prompt = self.IOS_DEFAULT_PROMPT
await self._exec_cmd(self._parse_init_dev_data,
["show version"], None, 'text',
reconnect=reconnect)
Expand All @@ -1689,6 +1688,7 @@ async def _ssh_connect(self):
enough as we need to start an interactive session for XE.
"""
await super()._ssh_connect()
self.prompt = self.IOS_DEFAULT_PROMPT

if self.is_connected and not self._stdin:
self.logger.info(
Expand Down

0 comments on commit 0ff9edb

Please sign in to comment.