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

Safely handle a missing root user #1295

Merged
merged 1 commit into from
Mar 9, 2023

Conversation

ekohl
Copy link
Collaborator

@ekohl ekohl commented Feb 15, 2023

In 657cd71 it was assumed that Etc would never be available on Windows and that the LoadError would catch it. Turns out that was an invalid assumption. This uses the safe operator to gracefully handle it.

Fixes #1293

In 657cd71 it was assumed that Etc
would never be available on Windows and that the LoadError would catch
it. Turns out that was an invalid assumption. This uses the safe
operator to gracefully handle it.

Fixes: 657cd71
@hboetes
Copy link

hboetes commented Feb 16, 2023

I am hboetes and I approve of this PR. 🤓

PS C:\Users\h.boetes> puppet agent -t
Info: Using environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Error: Facter: Error while resolving custom fact fact='root_home', resolution='<anonymous>': undefined method `dir' for nil:NilClass
Info: Caching catalog for silverbox.example.com
Info: Applying configuration version '1676531979'
Error: /Stage[main]/Chocolatey::Install/Exec[install_chocolatey_official]: Provider powershell is not functional on this host
Error: /Stage[main]/Windows_base/Exec[Disable HideFileExt]: Provider powershell is not functional on this host
Error: /Stage[main]/Heliumv::Windows/Windows::Shortcut[C:/users/public/desktop/HeliumVClient-Nov2022.lnk]/Exec[windows-shortcut-C:/users/public/desktop/HeliumVClient-Nov2022.lnk]: Provider powershell is not functional on this host
Notice: Applied catalog in 23.16 seconds
PS C:\Users\h.boetes> puppet agent -t
Info: Using environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Notice: /File[C:/ProgramData/PuppetLabs/puppet/cache/lib/facter/root_home.rb]/content:

Notice: /File[C:/ProgramData/PuppetLabs/puppet/cache/lib/facter/root_home.rb]/content: content changed '{sha256}adb8bc86bbae05b0fcf1cd1dff680eade4b29876f8133311f0af02364a0270c4' to '{sha256}f07c76ca898e90bdb32b744c8639eceb96a06b2292c1e08c4827f96af1ca0d79'
Info: Loading facts
Info: Caching catalog for silverbox.example.com
Info: Applying configuration version '1676532192'
Error: /Stage[main]/Chocolatey::Install/Exec[install_chocolatey_official]: Provider powershell is not functional on this host
Error: /Stage[main]/Windows_base/Exec[Disable HideFileExt]: Provider powershell is not functional on this host
Error: /Stage[main]/Heliumv::Windows/Windows::Shortcut[C:/users/public/desktop/HeliumVClient-Nov2022.lnk]/Exec[windows-shortcut-C:/users/public/desktop/HeliumVClient-Nov2022.lnk]: Provider powershell is not functional on this host
Notice: Applied catalog in 21.54 seconds

@ekohl ekohl added the bugfix label Feb 16, 2023
@hboetes
Copy link

hboetes commented Feb 16, 2023

Thanks for the instructions, I have approved the change.

Copy link
Contributor

@LukasAud LukasAud left a comment

Choose a reason for hiding this comment

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

LGTM

@LukasAud LukasAud merged commit ef733aa into puppetlabs:main Mar 9, 2023
@LukasAud
Copy link
Contributor

LukasAud commented Mar 9, 2023

Thanks for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants