-
Notifications
You must be signed in to change notification settings - Fork 98
Execute SSH readiness check in 'netlab initial' #3037
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
|
It turns out that it's unsafe to configure cEOS container before its SSH server is ready. As I wanted to be able to configure them without Ansible, I had to implement the "SSH readiness" check in Python (in netlab initial). This PR implements the core functionality; there are still a few rough edges that will get polished after merging this one. For example, there's no need to repeat the test in the Ansible playbook. Comments (including the usability of the feature) are highly recommended. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Adds an SSH-based device readiness check that runs as part of netlab initial configuration deployment.
Changes:
- Extends
netlab initial --debugoptions to include ansshdebug flag. - Introduces a new SSH readiness implementation (
netsim/cli/initial/ready.py) and a dispatcher for readiness steps based onnetlab_ready. - Invokes readiness checks from
netlab initialdeployment flow before configuration deployment.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| netsim/cli/initial/utils.py | Adds ssh to the hidden debug choices so SSH readiness diagnostics can be enabled. |
| netsim/cli/initial/ready.py | Implements the SSH readiness check and a device_ready() dispatcher keyed off netlab_ready. |
| netsim/cli/initial/deploy.py | Calls ready.device_ready() before pushing configurations to devices. |
Speaking of rough edges: interrupting "netlab up" (which calls "netlab initial") with ctrl/c while we're waiting for SSH servers works (as in "kills everything and gets back to bash prompt") but does not generate the "user interrupted.." message even though the code is already wrapped into try/except KeyboardInterrupt block in the netlab/initial run function. Any potential solution would be highly appreciated ;) /cc @Muddyblack |
No description provided.