|
19 | 19 | has_feature :provider_options
|
20 | 20 |
|
21 | 21 | # @return [String] The path to network-script directory on redhat systems
|
22 |
| - SCRIPT_DIRECTORY = '/etc/sysconfig/network-scripts' |
| 22 | + SCRIPT_DIRECTORY = '/etc/sysconfig/network-scripts'.freeze |
23 | 23 |
|
24 | 24 | # The valid vlan ID range is 0-4095; 4096 is out of range
|
25 | 25 | VLAN_RANGE_REGEX = /\d{1,3}|40[0-9][0-5]/
|
|
35 | 35 | :name => 'DEVICE',
|
36 | 36 | :hotplug => 'HOTPLUG',
|
37 | 37 | :mtu => 'MTU',
|
38 |
| - } |
| 38 | + }.freeze |
39 | 39 |
|
40 | 40 | # Map provider instances to files based on their name
|
41 | 41 | #
|
@@ -89,7 +89,7 @@ def self.parse_file(filename, contents)
|
89 | 89 | # Strip out all comments
|
90 | 90 | lines.map! { |line| line.sub(/#.*$/, '') }
|
91 | 91 | # Remove all blank lines
|
92 |
| - lines.reject! { |line| line.match(/^\s*$/) } |
| 92 | + lines.reject! { |line| line =~ /^\s*$/ } |
93 | 93 |
|
94 | 94 | pair_regex = /^\s*(.+?)\s*=\s*(.*)\s*$/
|
95 | 95 |
|
@@ -117,11 +117,11 @@ def self.parse_file(filename, contents)
|
117 | 117 | # issue that caused this, and https://github.com/adrienthebo/puppet-network/issues/16
|
118 | 118 | # for the resolution.
|
119 | 119 | #
|
120 |
| - props.merge!(:family => :inet) |
| 120 | + props[:family] = :inet |
121 | 121 |
|
122 | 122 | # If there is no DEVICE property in the interface configuration we retrieve
|
123 | 123 | # the interface name from the file name itself
|
124 |
| - props.merge!(:name => filename.split('ifcfg-')[1]) unless props.key?(:name) |
| 124 | + props[:name] = filename.split('ifcfg-')[1] unless props.key?(:name) |
125 | 125 |
|
126 | 126 | # The FileMapper mixin expects an array of providers, so we return the
|
127 | 127 | # single interface wrapped in an array
|
|
0 commit comments