Skip to content
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

EOS add force_cfg_session_invalid argument #1927

Merged
merged 4 commits into from
May 19, 2023
Merged

Conversation

ktbyers
Copy link
Contributor

@ktbyers ktbyers commented May 19, 2023

This allows the self.config_session to be invalidated on certain failures (right now a discard_config() failure).

kpetremann and others added 3 commits May 15, 2023 18:48
If the abort command is refused, for instance because of a TACACS issue
the config_session is never cleared because an exception is raised by
self._run_commands.

This is an issue in Saltstack case:
- a pending session could contain incomplete changes
- this pending session is resumed on the next load_config call causing
  messed up configuration

This change ensure the config_session is always cleared.
@ktbyers
Copy link
Contributor Author

ktbyers commented May 19, 2023

CC: @kpetremann @bewing

Slight changes to the previous solution.

Do you see any issues?

@kpetremann
Copy link
Contributor

@ktbyers sure :) actually I was hesitating with try except approach. I just tend to choose the solution with less, but that is only code style 😁

@kpetremann
Copy link
Contributor

with less indentation*

@ktbyers
Copy link
Contributor Author

ktbyers commented May 19, 2023

Yeah, it is six of one half dozen of the other...we thought this showed in the code when this case would happen a bit clearer (i.e. it is when the discard fails that we need to potentially do this override).

@kpetremann
Copy link
Contributor

we thought this showed in the code when this case would happen a bit clearer (i.e. it is when the discard fails that we need to potentially do this override).

you are totally right, it is more obvious that way.
Thanks

@ktbyers ktbyers merged commit f1ce50e into develop May 19, 2023
@ktbyers ktbyers deleted the clear_session_discard branch February 28, 2024 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants