59
60
61
62
63
64
65
66
67
68
69
70
71
|
# File 'lib/hammer_cli_foreman_scc_manager/scc_account.rb', line 59
def execute
response = send_request
print_message('Sync process successfully started:')
print_message(_('Started at: %{param}') % { param: response['started_at'] })
print_message(_('State: %{param}') % { param: response['state'] })
print_message(_('State updated at: %{param}') % { param: response['state_updated_at'] })
print_message(_('Task ID: %{param}') % { param: response['id'] })
HammerCLI::EX_OK
rescue RestClient::UnprocessableEntity => e
response = JSON.parse(e.response)
print_message(_('Sync process failed, error: %{param}') % { param: response['error'] })
HammerCLI::EX_TEMPFAIL
end
|