Module: HammerCLIKatello::UnsupportedKatelloAgentCommandHelper

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.host_collection_help_textObject



8
9
10
11
12
# File 'lib/hammer_cli_katello/unsupported_katello_agent_command_helper.rb', line 8

def self.host_collection_help_text
  "Specify the host collection with the --search-query " \
    "parameter, e.g. `--search-query \"host_collection = MyCollection\"` or " \
    "`--search-query \"host_collection_id=6\"`"
end

.included(base) ⇒ Object



14
15
16
17
18
19
20
21
22
23
# File 'lib/hammer_cli_katello/unsupported_katello_agent_command_helper.rb', line 14

def self.included(base)
  alternate_command = "hammer job-invocation create --feature #{base.rex_feature}"
  message = "Use the remote execution equivalent `#{alternate_command}`."
  if base.name =~ /HostCollection/
    message = "#{message} #{host_collection_help_text}"
  end
  base.desc "Not supported. #{message}"
  base.failure_message "Not supported. #{message}"
  base.option ["-h", "--help"], :flag, "Unsupported Operation - #{message}"
end

Instance Method Details

#executeObject



3
4
5
6
# File 'lib/hammer_cli_katello/unsupported_katello_agent_command_helper.rb', line 3

def execute
  print_message(failure_message)
  HammerCLI::EX_UNAVAILABLE
end