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

Make fact gluster_host suppress the error output, if Resolv.getaddres… #57

Closed
wants to merge 1 commit into from

Conversation

derjohn
Copy link

@derjohn derjohn commented Aug 11, 2015

…s does not work at all, e.g. DNS setup not complete during provisioning stage of a VM.

…s does not work at all, e.g. DNS setup not complete during provisioning stage of a VM.
@purpleidea
Copy link
Owner

@derjohn Good idea, but wouldn't your rather have this be || nil ? so that the following nil check applies?

@derjohn
Copy link
Author

derjohn commented Aug 12, 2015

Hm,
there is still uncatched error output, which makes facter error ....

@derjohn
Copy link
Author

derjohn commented Aug 12, 2015

I think that's the way to go. I'll create a new pull request.

Works not:

irb(main):007:0> Resolv.getaddress 'fitze.fatze'
Resolv::ResolvError: no address for fitze.fatze
        from /home/aj/.rbenv/versions/2.1.2/lib/ruby/2.1.0/resolv.rb:93:in `getaddress'
        from /home/aj/.rbenv/versions/2.1.2/lib/ruby/2.1.0/resolv.rb:43:in `getaddress'
        from (irb):7
        from /home/aj/.rbenv/versions/2.1.2/bin/irb:11:in `<main>'

Works:

irb(main):022:0> begin
irb(main):023:1* Resolv.getaddress 'fitze.fatze'
irb(main):024:1> rescue Resolv::ResolvError => e
irb(main):025:1> # psssst
irb(main):026:1* end
=> nil

@derjohn derjohn closed this Aug 12, 2015
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.

None yet

2 participants