-
Notifications
You must be signed in to change notification settings - Fork 681
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
os_env resource returns only user's environment variable on Windows #2945
os_env resource returns only user's environment variable on Windows #2945
Conversation
added new target parameter to os_env. Signed-off-by: Omar J Irizarry <[email protected]>
integration tests Signed-off-by: Omar J Irizarry <[email protected]>
Signed-off-by: Omar J Irizarry <[email protected]>
Signed-off-by: Omar J Irizarry <[email protected]>
Signed-off-by: Omar J Irizarry <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @omar-irizarry! This is a great enhancement. Would you mind adding an example here?https://github.com/chef/inspec/blob/master/docs/resources/os_env.md.erb
Signed-off-by: Omar J Irizarry <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a conditional in there that is, um, unorthodox, but it's sounds. I tested it on win2016 on an EC2 instance, all's well. Thanks @omar-irizarry !
@osenv = env | ||
@target = unless target.nil? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An inline unless
with a block dual-arm if
block. Yes!
Enhance os_env resource to deal with scenario explained in issue #2940
os_env resource may be called with one parameter, this keeps the current functionality
os_env resource may be called with two parameters
target values may be system or user