Module: HammerCLIForeman::ResourceSupportedTest

Instance Method Summary collapse

Instance Method Details

#executeObject



5
6
7
8
9
10
11
12
# File 'lib/hammer_cli_foreman/resource_supported_test.rb', line 5

def execute
  if resource_supported?
    super
  else
    output.print_error "The server does not support such operation."
    1
  end
end

#resource_supported?Boolean

Returns:

  • (Boolean)


14
15
16
17
18
19
# File 'lib/hammer_cli_foreman/resource_supported_test.rb', line 14

def resource_supported?
  resource.index
  true
rescue RestClient::ResourceNotFound => e
  false
end