incubator-ambari-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Onischuk (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (AMBARI-3082) Ambari-Client Some bad api calls does not raise exceptions
Date Tue, 03 Sep 2013 19:41:51 GMT

    [ https://issues.apache.org/jira/browse/AMBARI-3082?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13756971#comment-13756971
] 

Andrew Onischuk commented on AMBARI-3082:
-----------------------------------------

With this we can get exceptions for all the errors. Also now It adds an error message from
json to the exception text.
{code}
Traceback (most recent call last):
  ...
  File "/root/incubator-ambari/ambari-client/src/main/python/ambari_client/core/rest_resource.py",
line 84, in invoke
    raise Exception(errMsg)
Exception: Command 'POST //hosts' failed with error 400. Attempted to add unknown hosts to
a cluster.  These hosts have not been registered with the server: c1
{code}

All the tests pass successfuly
{code}
----------------------------------------------------------------------
Ran 5 tests in 0.015s

OK
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.905s
[INFO] Finished at: Tue Sep 03 12:19:58 PDT 2013
[INFO] Final Memory: 3M/161M
[INFO] ------------------------------------------------------------------------
{code}
                
> Ambari-Client Some bad api calls does not raise exceptions
> ----------------------------------------------------------
>
>                 Key: AMBARI-3082
>                 URL: https://issues.apache.org/jira/browse/AMBARI-3082
>             Project: Ambari
>          Issue Type: Task
>            Reporter: Andrew Onischuk
>            Assignee: Andrew Onischuk
>
> E.g: 
> Let's execute create_host on the host dev05.hortonworks.com, which is not registered:
> {code}
> hosts.create_host(client, 'dev05.hortonworks.com', '192.168.56.105')
> {code}
> We will the this errorcode after calling the api call, but no exception is raised
> {code}
> {
>   "status" : 400,
>   "message" : "Attempted to add unknown hosts to a cluster.  These hosts have not been
registered with the server: dev05.hortonworks.com"
> }
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message