Class: Chef::Knife::SavedSearchList

Inherits:
Chef::Knife show all
Includes:
SavedSearchBase
Defined in:
lib/chef/knife/saved_search_list.rb

Instance Method Summary collapse

Methods included from SavedSearchBase

#data_bag, included

Instance Method Details

#runObject



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/chef/knife/saved_search_list.rb', line 11

def run
  list = Chef::DataBag.load(data_bag)
rescue Net::HTTPServerException => e
  if e.response.code.to_i == 404
    warn "\"#{data_bag}\" data bag does not exist. No saved searches could be found."
  else
    raise
  end
ensure
  output format_list_for_display(list || {})
end