Skip to content
This repository has been archived by the owner on Aug 30, 2024. It is now read-only.

Validate params related to bind interface #86

Open
nephomaniac opened this issue Nov 16, 2015 · 1 comment
Open

Validate params related to bind interface #86

nephomaniac opened this issue Nov 16, 2015 · 1 comment

Comments

@nephomaniac
Copy link

Currently the cookbooks are referencing attributes related to the bind interface but do not have sane defaults and nil/null checks in place. The usage and presence of these attributes needs to be covered by Calyptos validations, as well as handled better in the Cookbooks themselves.

@nephomaniac
Copy link
Author

Examples:

  • Ceph cb references config->bind-interface but needs checks for nil or undef.
  • Calyptos needs to validate the correctness of the bind addr and the addresses used for registration.
  • Euca CB also needs to check/use the correct addr(s) in regards to the bind addr provided
  • Euca CB has some checks but needs more:
    ================================================================================^[[0m
    ^[[31mRecipe Compile Error in /root/.chef/local-mode-cache/cache/cookbooks/eucalyptus/recipes/user-facing.rb^[[0m
    ================================================================================^[[0m

^[[0mNoMethodError^[[0m
-------------^[[0m
undefined method `first' for nil:NilClass^[[0m

^[[0mCookbook Trace:^[[0m
---------------^[[0m
/root/.chef/local-mode-cache/cache/cookbooks/eucalyptus/libraries/bind-addr.rb:27:in get_bind_interface_ip' ^[[0m /root/.chef/local-mode-cache/cache/cookbooks/eucalyptus/recipes/cloud-service.rb:43:infrom_file'
^[[0m /root/.chef/local-mode-cache/cache/cookbooks/eucalyptus/recipes/user-facing.rb:22:in `from_file'^[[0m

^[[0mRelevant File Content:^[[0m
----------------------^[[0m
/root/.chef/local-mode-cache/cache/cookbooks/eucalyptus/libraries/bind-addr.rb:
^[[0m
^[[0m 20:
^[[0m 21: module Eucalyptus
^[[0m 22: module BindAddr
^[[0m 23: def self.get_bind_interface_ip(node)
^[[0m 24: bind_interface = node["eucalyptus"]["bind-interface"]
^[[0m 25: raise "Setting the bind interface was requested but not bind-interface parameter was set" if bind_interface.nil?
^[[0m 26: if node["network"]["interfaces"].has_key? bind_interface
^[[0m 27>> bind_addr = node[:network][:interfaces][bind_interface][:addresses].find {|addr, addr_info| addr_info[:family] == "inet"}.first
^[[0m 28: bind_addr
^[[0m 29: else
^[[0m 30: raise "Unable to find requested bind interface #{bind_interface} on #{node["ipaddress"]}"
^[[0m 31: end
^[[0m 32: end
^[[0m 33: end
^[[0m 34: end
^[[0m 35: ^[[0m

^[[0m^[[0m

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant