72
73
74
75
76
77
78
79
80
81
82
83
84
|
# File 'lib/hammer_cli_foreman_scc_manager/scc_account.rb', line 72
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
|