voxpupuli / puppet-network

Types and providers to manage network interfaces
https://forge.puppet.com/puppet/network
Apache License 2.0
66 stars 108 forks source link

change reference files for test about routes on redhat #218

Closed kapouik closed 2 years ago

kapouik commented 7 years ago

All RHel/Centos version support format IP/prefixlen but RHel/Centos 7 don't support IP/netmask.

More detail on the issue 209.

As it, I have change the references files that are used to make test on redhat. After this change : travis-ci will fail all test.

rski commented 7 years ago

hi @kapouik will you follow up on this with a commit that fixes the code?

kapouik commented 7 years ago

Sorry but I'm really bad with ruby. I have try to correct the code but for the moment, I don't have find how to patch correctly.

For the moment, I have this minor change that begin to correct one part of the code : https://github.com/kapouik/voxpupuli-puppet-network/blob/centos/lib/puppet/provider/network_route/redhat.rb#L61

    # use the CIDR version of the target as :name
    network, netmask = route[0].split('/')
    prefix = IPAddr.new(netmask).to_i.to_s(2).count('1')
    cidr_target = "#{network}/#{prefix}"

    new_route[:name]    = cidr_target
    new_route[:network] = network
    new_route[:netmask] = prefix

but it not correct parsing route-ethx files and it continu to write bad format.