Class: ICSP::Commands::Container::Check

Inherits:
BaseCommand show all
Defined in:
lib/commands/container/check.rb

Instance Attribute Summary

Attributes inherited from BaseCommand

#arguments, #config, #options, #prompt

Instance Method Summary collapse

Methods inherited from BaseCommand

#initialize

Constructor Details

This class inherits a constructor from ICSP::Commands::BaseCommand

Instance Method Details

#csptestObject



7
8
9
# File 'lib/commands/container/check.rb', line 7

def csptest
  @csptest ||= @config.csptest
end

#executeObject



11
12
13
14
15
16
# File 'lib/commands/container/check.rb', line 11

def execute
  result = ::ICSP::Shell.new("#{csptest} -keyset -check -cont '#{selected_container}'").execute
  exit(result.exit_code) unless result.ok

  puts result
end

#selected_containerObject



18
19
20
# File 'lib/commands/container/check.rb', line 18

def selected_container
  ::ICSP::Commands::Container::List.new(config: config, options: options, arguments: arguments).select
end