-
Notifications
You must be signed in to change notification settings - Fork 682
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
Handle xinetd config with only one entry #846
Conversation
should fix #845 |
# add the service identifier to its parameters | ||
v.each { |service| service.params['service'] = name } |
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.
Minro style point. You might consider avoidng the type check and doing:
Array(v).each { |service| service.params['service'] = name }
Array(v) will coerce a scalar into an array but won't touch the arg if it is already an array:
Airb(main):001:0> Array(4)
=> [4]
irb(main):002:0> Array([4])
=> [4]
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.
Yes, that makes it more save.
Overall this looks good to me. I'm wondering if in the future the thing we actually want to store is a merged view of the config for a given service. |
Lets double-check if we should move this logic to the parser |
62280d9
to
9f685a9
Compare
9f685a9
to
c23263f
Compare
I like the current version and the functionality in here 👍 |
This PR handles a bug reported by @kdshah1 via gitter:
is this the correct way to check xinetd services are disabled?
It fails with following message:
whereas my telnet file under /etc/xinet.d reads this:
The problem was, that the xinetd resource was expecting multiple entries via
includedir /etc/xinetd.d
. This PR also adds another test to catch that case.