summaryrefslogtreecommitdiff
path: root/lib/chef/provider/ifconfig.rb
diff options
context:
space:
mode:
authorkaustubh-d <kaustubh@clogeny.com>2013-07-17 23:56:31 -0500
committeradamedx <adamed@opscode.com>2013-07-23 10:36:14 -0700
commit72d6195179f2846220aace216e9b1089e8efc95b (patch)
tree72f2dcc5416c9a659060a36ae3b49d064a19f7b9 /lib/chef/provider/ifconfig.rb
parentf5954328189955375b4f91260283572066a803e3 (diff)
downloadchef-72d6195179f2846220aace216e9b1089e8efc95b.tar.gz
process ifconfig add/enable actions for aix vip, use platform specific loopback interface.
Diffstat (limited to 'lib/chef/provider/ifconfig.rb')
-rw-r--r--lib/chef/provider/ifconfig.rb13
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/chef/provider/ifconfig.rb b/lib/chef/provider/ifconfig.rb
index bfeb725954..44d99e455d 100644
--- a/lib/chef/provider/ifconfig.rb
+++ b/lib/chef/provider/ifconfig.rb
@@ -101,8 +101,8 @@ class Chef
def action_add
# check to see if load_current_resource found interface in ifconfig
- unless @current_resource.inet_addr
- unless @new_resource.device == "lo"
+ if @current_resource.inet_addr.nil? || @new_resource.is_vip
+ unless @new_resource.device == loopback_device
command = add_command
converge_by ("run #{command} to add #{@new_resource}") do
run_command(
@@ -119,8 +119,8 @@ class Chef
def action_enable
# check to see if load_current_resource found ifconfig
# enables, but does not manage config files
- unless @current_resource.inet_addr
- unless @new_resource.device == "lo"
+ if @current_resource.inet_addr.nil? || @new_resource.is_vip
+ unless @new_resource.device == loopback_device
command = enable_command
converge_by ("run #{command} to enable #{@new_resource}") do
run_command(
@@ -215,7 +215,10 @@ class Chef
def delete_command
"ifconfig #{@new_resource.device} down"
end
-
+
+ def loopback_device
+ 'lo'
+ end
end
end
end