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

undefined method `bond=' for Chef::Resource::NetworkInterfaces #23

Closed
hun7er opened this issue Feb 12, 2015 · 6 comments
Closed

undefined method `bond=' for Chef::Resource::NetworkInterfaces #23

hun7er opened this issue Feb 12, 2015 · 6 comments

Comments

@hun7er
Copy link

hun7er commented Feb 12, 2015

if I define resource from attributes

include_recipe "network_interfaces"
  node["netconf"]["interfaces"].each do |nic|
    network_interfaces nic[0] do
      ...
      bond nic[1]['bond'] if nic[1].attribute?('bond')
      ...
  end
end
Recipe: netconf::default
  * network_interfaces[bond0] action save

    ================================================================================
    Error executing action `save` on resource 'network_interfaces[bond0]'
    ================================================================================

    NoMethodError
    -------------
    undefined method `bond=' for Chef::Resource::NetworkInterfaces

    Cookbook Trace:
    ---------------
    /var/chef-solo/cookbooks/network_interfaces/providers/default.rb:12:in `block in class_from_file'

    Resource Declaration:
    ---------------------
    # In /var/chef-solo/cookbooks/netconf/recipes/default.rb

      8:   network_interfaces nic[0] do
      9:     target nic[1]['target'] if nic[1].attribute?('target')
     10:     network nic[1]['network'] if nic[1].attribute?('network')
     11:     mask nic[1]['mask'] if nic[1].attribute?('mask')
     12:     gateway nic[1]['gateway'] if nic[1].attribute?('gateway')
     13:     broadcast nic[1]['broadcast'] if nic[1].attribute?('broadcast')
     14:     bridge nic[1]['bridge'] if nic[1].attribute?('bridge')
     15:     bridge_stp nic[1]['bridge_stp'] if nic[1].attribute?('bridge_stp')
     16:     vlan_dev nic[1]['vlan_dev'] if nic[1].attribute?('vlan_dev')
     17:     bond nic[1]['bond'] if nic[1].attribute?('bond')
     18:     bond_mode nic[1]['bond_mode'] if nic[1].attribute?('bond_mode')
     19:     #metric nic[1]['metric'] if nic[1].attribute?('metric')
     20:     #mtu nic[1]['mtu'] if nic[1].attribute?('mtu')
     21:     pre_up nic[1]['pre_up'] if nic[1].attribute?('pre_up')
     22:     up nic[1]['up'] if nic[1].attribute?('up')
     23:     post_up nic[1]['post_up'] if nic[1].attribute?('post_up')
     24:     pre_down nic[1]['pre_down'] if nic[1].attribute?('pre_down')
     25:     down nic[1]['down'] if nic[1].attribute?('down')
     26:     post_down nic[1]['post_down'] if nic[1].attribute?('post_down')
     27:     custom nic[1]['custom'] if nic[1].attribute?('custom')
     28:   end
     29: end

    Compiled Resource:
    ------------------
    # Declared in /var/chef-solo/cookbooks/netconf/recipes/default.rb:8:in `block in from_file'

    network_interfaces("bond0") do
      action :save
      retries 0
      retry_delay 2
      default_guard_interpreter :default
      declared_type :network_interfaces
      cookbook_name :netconf
      recipe_name "default"
      bond ["none"]
      device "bond0"
    end
@jeffbyrnes
Copy link
Contributor

@hun7er are you using Chef 12? There's a known bug that looks a lot like this, actually. I'll try to dig up the details for you.

@hun7er
Copy link
Author

hun7er commented Feb 13, 2015

Yes, I use chef12, but 11.16.4 the same problem.

@hun7er
Copy link
Author

hun7er commented Feb 20, 2015

👍

@jeffbyrnes
Copy link
Contributor

If it's affected you with Chef 11, it's probably not the same issue, but here's some details on the Chef 12 bug that I was thinking of: chef/chef#2575.

As I said though, if it’s happening w/ Chef 11, then something else is afoot…

@github-actions
Copy link

Marking stale due to inactivity. Remove stale label or comment or this will be closed in 7 days. Alternatively drop by the #sous-chefs channel on the Chef Community Slack and we'll be happy to help! Thanks, Sous-Chefs.

@github-actions github-actions bot added the Stale label Sep 30, 2020
@xorimabot xorimabot removed the Stale label Sep 30, 2020
@jeffbyrnes
Copy link
Contributor

Going to close this, as it’s very stale, but please re-open if it’s still a concern.

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

No branches or pull requests

3 participants