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

fix "absent" options #161

Merged
merged 1 commit into from
May 6, 2016
Merged

fix "absent" options #161

merged 1 commit into from
May 6, 2016

Conversation

igalic
Copy link
Contributor

@igalic igalic commented May 6, 2016

analogous to redhat, we check if options are absent, before appending
them to the file. This fixes #160

analogous to redhat, we check if options are absent, before appending
them to the file. This fixes #160
@@ -91,7 +91,8 @@ def self.format_file(_filename, providers)
raise Puppet::Error, "#{provider.name} is missing the required parameter 'gateway'." if provider.gateway.nil?
raise Puppet::Error, "#{provider.name} is missing the required parameter 'interface'." if provider.interface.nil?

contents << "#{provider.network} #{provider.netmask} #{provider.gateway} #{provider.interface} #{provider.options}\n"
contents << "#{provider.network} #{provider.netmask} #{provider.gateway} #{provider.interface}"
contents << (provider.options == :absent ? "\n" : " #{provider.options}\n")
Copy link
Member

Choose a reason for hiding this comment

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

I'm not a big fan of encapsulated ternary. What do you think @igalic, do we want to keep it or reformat?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

contrast that with the code i replace in redhat.rb

Copy link
Member

Choose a reason for hiding this comment

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

ah. yep.

@bastelfreak
Copy link
Member

maybe change the ternary. IMO it is not very readable in combination with the encapsulation and <<. Rest looks fine 👍

@bastelfreak bastelfreak merged commit 7d23235 into voxpupuli:master May 6, 2016
@igalic igalic deleted the ipv6r branch May 6, 2016 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

innitial creation of debian routes sets options as absent
2 participants