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

Fix onevnet provider for dns and network_mask #172

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ onevnet { '<name>':
bridge => 'basebr0',
# name of the physical interface on which the bridge wiull run
phydev => 'br0',
dns_servers => ['8.8.8.8', '4.4.4.4'],
dnsservers => ['8.8.8.8', '4.4.4.4'],
gateway => '10.0.2.1',
# add vlanid
vlanid => '1550',
Expand Down
6 changes: 5 additions & 1 deletion lib/puppet/provider/onevnet/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def self.instances
:ensure => :present,
:bridge => vnet.xpath('./BRIDGE').text,
:context => nil,
:dnsservers => (vnet.xpath('./TEMPLATE/DNS').text.to_a unless vnet.xpath('./TEMPLATE/DNS').nil?),
:dnsservers => (vnet.xpath('./TEMPLATE/DNS').text.split(" ") unless vnet.xpath('./TEMPLATE/DNS').nil?),
:gateway => (vnet.xpath('./TEMPLATE/GATEWAY').text unless vnet.xpath('./TEMPLATE/GATEWAY').nil?),
:netmask => (vnet.xpath('./TEMPLATE/NETWORK_MASK').text unless vnet.xpath('./TEMPLATE/NETWORK_MASK').nil?),
:network_address => (vnet.xpath('./TEMPLATE/NETWORK_ADDRESS').text unless vnet.xpath('./TEMPLATE/NETWORK_ADDRESS').nil?),
Expand Down Expand Up @@ -127,6 +127,10 @@ def flush
when :addressrange
k.each_pair do |key, value|
end
when :dnsservers
[ 'DNS', "\"#{v.join(" ")}\"" ]
when :netmask
[ 'NETWORK_MASK', v ]
else
[ k.to_s.upcase, v ]
end
Expand Down
8 changes: 4 additions & 4 deletions spec/acceptance/onevnet_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class { 'one':
ensure => present,
bridge => 'basebr0',
phydev => 'br0',
dnsservers => ['8.8.8.8', '4.4.4.4'],
dnsservers => ['8.8.8.8', '4.4.4.4'],
gateway => '10.0.2.1',
vlanid => '1550',
netmask => '255.255.0.0',
Expand All @@ -36,7 +36,7 @@ class { 'one':
ensure => present,
bridge => 'basebr0',
phydev => 'br0',
dnsservers => ['8.8.8.8', '4.4.4.4'],
dnsservers => ['8.8.8.8', '4.4.4.4'],
gateway => '10.0.2.1',
vlanid => '1550',
netmask => '255.255.0.0',
Expand Down Expand Up @@ -64,7 +64,7 @@ class { 'one':
ensure => present,
bridge => 'basebr0',
phydev => 'br0',
dnsservers => ['8.8.8.8', '4.4.4.4'],
dnsservers => ['8.8.8.8', '4.4.4.4'],
gateway => '10.0.2.1',
vlanid => '1550',
netmask => '255.255.0.0',
Expand Down Expand Up @@ -92,7 +92,7 @@ class { 'one':
ensure => present,
bridge => 'basebr0',
phydev => 'br0',
dnsservers => ['8.8.8.8', '4.4.4.4'],
dnsservers => ['8.8.8.8', '4.4.4.4'],
gateway => '10.0.2.1',
vlanid => '1550',
netmask => '255.255.0.0',
Expand Down