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

Task enable disable #129

Closed
wants to merge 3 commits into from
Closed

Task enable disable #129

wants to merge 3 commits into from

Conversation

petewest
Copy link
Contributor

Add actions to enable and disable windows tasks.

Chef::Log.info "#{@new_resource} task enabled"
end
else
Chef::Log.debug "#{@new_resource} task doesn't exist - nothing to do"
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this should raise an error in this case. You asked Chef to enable a task, and it can't do what you asked.

We've talked about this situation in the past when it comes to services and tend to accept the argument that you should be able to disable services that don't exist because they could be part of a security effort to make sure certain services don't run, but enabling services (or tasks) is a different matter.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense, what error would you raise?

Copy link
Contributor

Choose a reason for hiding this comment

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

raise Errno::ENOENT, "#{@new_resource}: task does not exist, cannot enable"

@btm
Copy link
Contributor

btm commented Dec 11, 2014

yeah, let's just toss an exception in there and this is 👍

@btm
Copy link
Contributor

btm commented Dec 15, 2014

Merged to master, with the exception and added windows_task to the new integration test code. Thanks @petewest.

@btm btm closed this Dec 15, 2014
@petewest petewest deleted the task-enable-disable branch December 22, 2014 15:02
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.

3 participants