class Chef::Knife::RoleEnvRunListRemove
Public Instance Methods
remove_from_env_run_list(role, environment, item_to_remove)
click to toggle source
# File lib/chef/knife/role_env_run_list_remove.rb, line 32 def remove_from_env_run_list(role, environment, item_to_remove) nlist = [] role.run_list_for(environment).each do |entry| nlist << entry unless entry == item_to_remove # unless entry == @name_args[2] # nlist << entry # end end role.env_run_lists_add(environment => nlist) end
run()
click to toggle source
# File lib/chef/knife/role_env_run_list_remove.rb, line 43 def run role = Chef::Role.load(@name_args[0]) role.name(@name_args[0]) environment = @name_args[1] item_to_remove = @name_args[2] remove_from_env_run_list(role, environment, item_to_remove) role.save config[:env_run_list] = true output(format_for_display(role)) end