-
Notifications
You must be signed in to change notification settings - Fork 63
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
Fix root user authentication #503
base: main
Are you sure you want to change the base?
Fix root user authentication #503
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #503 +/- ##
=======================================
Coverage 82.58% 82.58%
=======================================
Files 139 139
Lines 13128 13128
=======================================
Hits 10842 10842
Misses 2286 2286 |
Signed-off-by: rohitthakur2590 <[email protected]>
058591e
to
822cdf6
Compare
I'm very interested in seeing a fix for this merged if possible. I also think the addition of a test for this case is valuable. I do think, however, that this fix can be simplified; you could set the Hope this helps, would love for this PR to get some more love! |
It looks like this was originally broken in ansible/ansible#62340 (released in ansible v2.8.5) which was fixing an issue with aggregate mode. I believe the bug at the time was that the original code (introduced in ansible v2.8.0) in which setting I think this will not be an issue if I would suggest a fix in which both arms of the condition at junipernetworks.junos/plugins/modules/junos_user.py Lines 271 to 279 in b445729
user and auth (and then neither should be set later in the code).
IMHO replacing that block with something like this would be a clean fix: if item["name"] == "root":
user = auth = SubElement(
element,
"root-authentication",
{"operation": operation},
)
else:
user = SubElement(login, "user", {"operation": operation})
SubElement(user, "name").text = item["name"]
auth = SubElement(user, "authentication") |
SUMMARY
ISSUE TYPE
COMPONENT NAME
ADDITIONAL INFORMATION