You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ambari.apache.org by "Greg Hill (JIRA)" <ji...@apache.org> on 2014/06/26 21:47:24 UTC

[jira] [Updated] (AMBARI-6294) Python client is broken when pycurl isn't installed

     [ https://issues.apache.org/jira/browse/AMBARI-6294?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Greg Hill updated AMBARI-6294:
------------------------------

    Description: 
If you don't have pycurl installed, trying to use the client causes a lot of problems.  This line in http_client.py is at fault:

try:
  import pycurl
except ImportError:
  from mock.mock import MagicMock
  pycurl = MagicMock() 


There are a few problems here:

1. The tests should do the mocking, it shouldn't be done automatically when running outside of tests.
2. mock.mock does not appear to be a valid module.  I can't install it via pip.  Did you mean 'from mock import MagicMock'?
3. There is no dependency set on either pycurl or mock.mock, so using pip to install ambari-client does not install it in a working state.

  was:
If you don't have pycurl installed, trying to use the client causes a lot of problems.  This line in http_client.py is at fault:

try:
  import pycurl
# pycurl is not necessary for testcases, mock it
except ImportError:
  from mock.mock import MagicMock
  pycurl = MagicMock() 


There are a few problems here:

1. The tests should do the mocking, it shouldn't be done automatically when running outside of tests.
2. mock.mock does not appear to be a valid module.  I can't install it via pip.  Did you mean 'from mock import MagicMock'?
3. There is no dependency set on either pycurl or mock.mock, so using pip to install ambari-client does not install it in a working state.


> Python client is broken when pycurl isn't installed
> ---------------------------------------------------
>
>                 Key: AMBARI-6294
>                 URL: https://issues.apache.org/jira/browse/AMBARI-6294
>             Project: Ambari
>          Issue Type: Bug
>          Components: client
>    Affects Versions: 1.6.0
>            Reporter: Greg Hill
>
> If you don't have pycurl installed, trying to use the client causes a lot of problems.  This line in http_client.py is at fault:
> try:
>   import pycurl
> except ImportError:
>   from mock.mock import MagicMock
>   pycurl = MagicMock() 
> There are a few problems here:
> 1. The tests should do the mocking, it shouldn't be done automatically when running outside of tests.
> 2. mock.mock does not appear to be a valid module.  I can't install it via pip.  Did you mean 'from mock import MagicMock'?
> 3. There is no dependency set on either pycurl or mock.mock, so using pip to install ambari-client does not install it in a working state.



--
This message was sent by Atlassian JIRA
(v6.2#6252)