Cherry pick iosxr admin fix (#40108)

* Exit admin mode properly on iosxr_config (#39594)

Fixes #38811

When using 'admin' in iosxr-config, we need to pass an end
to config terminal session but also pass exit so we exit admin
mode.

(cherry picked from commit 56c5567912)

* Add bugfix fragment
pull/39438/merge
Ricardo Carrillo Cruz 7 years ago committed by Matt Davis
parent abb0f4498f
commit 3115f31655

@ -0,0 +1,2 @@
bugfixes:
- Fix iosxr_config admin mode not exiting properly https://github.com/ansible/ansible/pull/39594

@ -426,6 +426,8 @@ def load_config(module, command_filter, commit=False, replace=False,
elif commit: elif commit:
commit_config(module, comment=comment) commit_config(module, comment=comment)
conn.edit_config('end') conn.edit_config('end')
if admin:
conn.edit_config('exit')
else: else:
conn.discard_changes() conn.discard_changes()

Loading…
Cancel
Save