You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ambari.apache.org by "Andrew Onischuk (JIRA)" <ji...@apache.org> on 2013/09/03 21:41:51 UTC

[jira] [Commented] (AMBARI-3082) Ambari-Client Some bad api calls does not raise exceptions

    [ 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