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

Malformed redhat files are generated #142

Closed
rski opened this issue Mar 10, 2016 · 3 comments
Closed

Malformed redhat files are generated #142

rski opened this issue Mar 10, 2016 · 3 comments

Comments

@rski
Copy link
Member

rski commented Mar 10, 2016

With the current master (1be5bcd) I get interface files that contain lines like MTU=absent. For example:

network_config { 'eth1':
  ensure      => present,
  family      => 'inet',
  #ipaddress   => '127.0.0.2',
  method      => 'static',
  netmask     => '255.255.255.0',
  onboot      => true,
  reconfigure => true,
  options     => {},
}

will generate:

IPADDR=absent
NETMASK=255.255.255.0
BOOTPROTO=static
ONBOOT=yes
DEVICE=eth1
HOTPLUG=yes
MTU=absent

Then, if I try to bring the interface up:

$ sudo ifup eth1
Error: argument "absent" is wrong: Invalid "mtu" value

This does not seem to happen with the debian provider

@igalic
Copy link
Contributor

igalic commented Mar 10, 2016

amazing _

@rski
Copy link
Member Author

rski commented Mar 10, 2016

Ok, this happens because every possible key is pushed in the options hash, so the ones that are not given a value end up with absent. I'll submit a pr to fix this soonish, but the way that :absent is checked for and treated by the provider needs to be sanity checked. Probably tests need to be written for that too. I don't really have enough ruby experience required to do this, so someone with a bit more knowledge should do it.
tl;dr all ifs and || let :absent pass through

@rski
Copy link
Member Author

rski commented Mar 11, 2016

fixed #143

@rski rski closed this as completed Mar 11, 2016
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

2 participants