Class: Chef::Knife::EncryptedAttributeShow

Inherits:
Core::EncryptedAttributeBase show all
Includes:
Core::EncryptedAttributeDepends
Defined in:
lib/chef/knife/encrypted_attribute_show.rb

Overview

knife encrypted attribute show command.

$ knife encrypted attribute show NODE ATTRIBUTE (options)

Instance Method Summary collapse

Methods included from Core::EncryptedAttributeDepends

included

Methods inherited from Core::EncryptedAttributeBase

#assert_attribute_does_not_exist, #assert_attribute_exists, #assert_attribute_readable, #attribute_path_to_ary, #attribute_path_to_ary_read_escape, #die, #option_assert, #parse_args

Instance Method Details

#assert_valid_argsObject

Raises:

  • (ArgumentError)

    if the attribute path format is wrong.



37
38
39
# File 'lib/chef/knife/encrypted_attribute_show.rb', line 37

def assert_valid_args
  assert_attribute_exists(@node_name, @attr_ary)
end

#runObject

Runs knife command.

Returns:

  • void

Raises:

  • (ArgumentError)

    if the attribute path format is wrong.

  • (UnacceptableEncryptedAttributeFormat)

    if encrypted attribute format is wrong.

  • (UnsupportedEncryptedAttributeFormat)

    if encrypted attribute format is not supported or unknown.

  • (SearchFailure)

    if there is a Chef search error.

  • (SearchFatalError)

    if the Chef search response is wrong.

  • (InvalidSearchKeys)

    if search keys structure is wrong.



52
53
54
55
56
57
58
# File 'lib/chef/knife/encrypted_attribute_show.rb', line 52

def run
  parse_args

  enc_attr =
    Chef::EncryptedAttribute.load_from_node(@node_name, @attr_ary)
  output(enc_attr)
end