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

add shadow resource for /etc/shadow #471

Merged
merged 1 commit into from
Feb 19, 2016
Merged

add shadow resource for /etc/shadow #471

merged 1 commit into from
Feb 19, 2016

Conversation

arlimus
Copy link
Contributor

@arlimus arlimus commented Feb 19, 2016

No description provided.


def initialize(path = nil, opts = nil)
opts ||= {}
@path = path || '/etc/shadow'
Copy link
Contributor

Choose a reason for hiding this comment

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

nitpicking, but how about

def initialize(path = '/etc/shadow', opts = {})

@srenatus
Copy link
Contributor

@arlimus: great resource. Went a little bonkers with non-important code style comments ;)

LGTM 👍

@@ -0,0 +1,130 @@
# encoding: utf-8
# copyright: 2015, Chef Software Inc.
Copy link
Contributor

Choose a reason for hiding this comment

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

2016 🎉

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ups :)

@arlimus arlimus force-pushed the dr/shadow branch 2 times, most recently from f5f187c to 2ee967e Compare February 19, 2016 13:08

def initialize(path = '/etc/shadow', opts = nil)
opts ||= {}
@path = path || '/etc/shadow'
Copy link
Contributor

Choose a reason for hiding this comment

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

This is redundant now, isn't it?
@path = path

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Almost: what if shadow(nil). It will not happen intentionally, but may happen by accident. I'm not sure yet how we want to handle this case though. Throwing a ruby fail seems too harsh, maybe improve this in the next iteration. It is true for a lot of resources...

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok, another edge case I didn't notice. Thanks.

My original comment then doesn't make too much sense then (i.e. the case against path=nil)...

@chris-rock
Copy link
Contributor

That looks really good. I like to see filter everywhere now.

@chris-rock
Copy link
Contributor

Thanks @arlimus

chris-rock added a commit that referenced this pull request Feb 19, 2016
add shadow resource for /etc/shadow
@chris-rock chris-rock merged commit 2180a1a into master Feb 19, 2016
@chris-rock chris-rock deleted the dr/shadow branch February 19, 2016 13:35
@chris-rock chris-rock added the Type: Enhancement Improves an existing feature label Feb 19, 2016
@chris-rock chris-rock modified the milestone: 0.13.0 Feb 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Improves an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants