Skip to content

ENT-14418: Added --ask-pass, --password-file and --switch-user-command options - #199

Merged
olehermanse merged 11 commits into
cfengine:masterfrom
nickanderson:ENT-14418
Sep 16, 2026
Merged

olehermanse merged 11 commits into
cfengine:masterfrom
nickanderson:ENT-14418

Conversation

@nickanderson

@nickanderson nickanderson commented Aug 14, 2026

Copy link
Copy Markdown
Member

cf-remote can now switch user on hosts where sudo asks for a password, prompting for it once with --ask-pass or reading it from a file with --password-file, so passwordless sudo is no longer a requirement. --switch-user-command replaces the hardcoded sudo bash -c.

@nickanderson
nickanderson requested review from SimonThalvorsen, larsewi and victormlg and removed request for victormlg August 14, 2026 16:24

@larsewi larsewi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

Comment thread cf_remote/aramid.py Outdated
Comment thread cf_remote/ssh.py Outdated
Comment thread tests/shell/002_sudo_password.sh Outdated
@nickanderson
nickanderson requested a review from larsewi August 18, 2026 17:35

@victormlg victormlg left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My comments

Comment thread cf_remote/ssh.py
Comment thread cf_remote/ssh.py
Comment thread cf_remote/main.py Outdated
@codecov

codecov Bot commented Sep 2, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 86.52482% with 19 lines in your changes missing coverage. Please review.
✅ Project coverage is 48.09%. Comparing base (f727a9a) to head (370fc2a).

Files with missing lines Patch % Lines
cf_remote/commands.py 61.11% 7 Missing ⚠️
cf_remote/main.py 68.75% 5 Missing ⚠️
cf_remote/ssh.py 95.18% 4 Missing ⚠️
cf_remote/aramid.py 83.33% 2 Missing ⚠️
cf_remote/remote.py 83.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #199      +/-   ##
==========================================
+ Coverage   45.01%   48.09%   +3.07%     
==========================================
  Files          18       18              
  Lines        3077     3169      +92     
==========================================
+ Hits         1385     1524     +139     
+ Misses       1692     1645      -47     
Files with missing lines Coverage Δ
cf_remote/args.py 100.00% <100.00%> (ø)
cf_remote/remote.py 32.67% <83.33%> (+0.44%) ⬆️
cf_remote/aramid.py 66.20% <83.33%> (+2.08%) ⬆️
cf_remote/ssh.py 82.50% <95.18%> (+8.09%) ⬆️
cf_remote/main.py 46.53% <68.75%> (+7.38%) ⬆️
cf_remote/commands.py 21.52% <61.11%> (+3.58%) ⬆️

... and 3 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread cf_remote/args.py
Comment thread cf_remote/aramid.py Outdated
Comment thread cf_remote/aramid.py Outdated
Comment thread cf_remote/args.py

@larsewi larsewi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

nickanderson and others added 11 commits September 16, 2026 12:56
Ticket: ENT-14418
Changelog: title
Signed-off-by: Nick Anderson <nick@cmdln.org>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Ticket: ENT-14418
Changelog: title
Signed-off-by: Nick Anderson <nick@cmdln.org>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Ticket: ENT-14418
Changelog: none
Signed-off-by: Nick Anderson <nick@cmdln.org>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Ticket: ENT-14418
Changelog: none
Signed-off-by: Nick Anderson <nick@cmdln.org>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…bals

Ticket: ENT-14418
Changelog: none
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Nick Anderson <nick@cmdln.org>
Ticket: ENT-14418
Changelog: none
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Nick Anderson <nick@cmdln.org>
Ticket: ENT-14418
Changelog: none
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Nick Anderson <nick@cmdln.org>
Ticket: ENT-14418
Changelog: none
Signed-off-by: Nick Anderson <nick@cmdln.org>
Ticket: ENT-14418
Changelog: none
Signed-off-by: Nick Anderson <nick@cmdln.org>
Ticket: ENT-14418
Changelog: none
Signed-off-by: Nick Anderson <nick@cmdln.org>
Ticket: ENT-14418
Changelog: none
Signed-off-by: Nick Anderson <nick@cmdln.org>
@olehermanse
olehermanse merged commit 2855355 into cfengine:master Sep 16, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants