Class: Chef::Knife::SoloDataBagEdit

Inherits:
Chef::Knife show all
Includes:
SoloDataBagHelpers
Defined in:
lib/chef/knife/solo_data_bag_edit.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.



15
16
17
# File 'lib/chef/knife/solo_data_bag_edit.rb', line 15

def bag_name
  @bag_name
end

#item_nameObject (readonly)

Returns the value of attribute item_name.



15
16
17
# File 'lib/chef/knife/solo_data_bag_edit.rb', line 15

def item_name
  @item_name
end

Instance Method Details

#runObject



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

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
  edit_content
end