Class: Chef::Knife::SoloDataBagShow

Inherits:
Chef::Knife show all
Includes:
SoloDataBagHelpers
Defined in:
lib/chef/knife/solo_data_bag_show.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from SoloDataBagHelpers

#bag_item_path, #bag_path, #bags_path, #convert_json_string, #persist_bag_item, #secret_key, #secret_path, #should_be_encrypted?, #validate_bag_name_provided, #validate_bags_path_exists, #validate_json_string, #validate_multiple_secrets_were_not_provided

Instance Attribute Details

#bag_nameObject (readonly)

Returns the value of attribute bag_name.



14
15
16
# File 'lib/chef/knife/solo_data_bag_show.rb', line 14

def bag_name
  @bag_name
end

#item_nameObject (readonly)

Returns the value of attribute item_name.



14
15
16
# File 'lib/chef/knife/solo_data_bag_show.rb', line 14

def item_name
  @item_name
end

Instance Method Details

#runObject



29
30
31
32
33
34
35
# File 'lib/chef/knife/solo_data_bag_show.rb', line 29

def run
  Chef::Config[:solo]   = true
  Chef::Config[:solo_legacy_mode] = true if Gem.loaded_specs['chef'].version > Gem::Version.new('12.11.0')
  @bag_name, @item_name = @name_args
  ensure_valid_arguments
  display_content
end