Closed andrefaranha closed 8 years ago
Which python version and operating system are you using?
@andrefaranha I could reproduce the issue, thank you for reporting it.
Sorry for the late response. I'm using python 2.7.12
After some research I realised that it is not a bug on the SDK, it happens after enabling the support for renamed standard library modules using the future library.
Basically, the same behaviour occurs replacing the import:
from hpOneView.oneview_client import OneViewClient
by the following lines:
from future import standard_library
standard_library.install_aliases()
There is an internal module on Python named test, that is being imported when the install_aliases is called. You can check the code at: https://github.com/PythonCharmers/python-future/blob/master/src/future/standard_library/__init__.py#L483
I suggest renaming your module from test to something else, to avoid the conflict with the Python's internal module.
@andrefaranha have you seen @marikrg comment about this Issue ? Did it solve your problem ?
@andrefaranha since we didn't have a response, I'll close the issue. If you find that this problem still happens after applying the steps suggested by @marikrg, please reopen this issue.
We are facing a weird problem when using python-hpOneView. All statements are running twice after adding the import.
Example:
Before importing:
Output:
After importing:
Expected Output:
Actual Output:
UPDATE:
It worked as expected after adding
if __name__ == '__main__'
:Output: