Module: HammerCLIForeman::ResourceSupportedTest
- Included in:
- Location::CreateCommand, Location::DeleteCommand, Location::InfoCommand, Location::ListCommand, Location::UpdateCommand, Organization::CreateCommand, Organization::DeleteCommand, Organization::InfoCommand, Organization::ListCommand, Organization::UpdateCommand
- Defined in:
- lib/hammer_cli_foreman/resource_supported_test.rb
Instance Method Summary collapse
Instance Method Details
#execute ⇒ Object
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
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 |