Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enclosure_groups.create() Does not take valid data and returns JSON error #103

Closed
saketmarodia opened this issue Oct 30, 2020 · 6 comments
Closed

Comments

@saketmarodia
Copy link

I am facing the same issue while EG creation, The JSON is valid and Creates a EG if the REST endpoint.
uri2="https://"+IP+"/rest/enclosure-groups"
response2 = requests.post(uri2,verify=False,json=EG_data,headers=Headers)

But it gives an error when using the Python SDK.

This is the same issue as Issue #84

@yuvirani
Copy link
Contributor

yuvirani commented Nov 3, 2020

@saketmarodia, We have fixed the issue and the changes have been merged. Please check it once and let us know the results.

@Georgimi
Copy link

Georgimi commented Nov 3, 2020

Well , i tried with the new version today and still facing the same issue as well.
JSON is valid but SDK shows ('Unrecognized JSON field.', {'errorCode': 'UNRECOGNIZED_JSON_FIELD', 'message': 'Unrecognized JSON field.', 'details': 'The field named type near line 1, column 11 is not a valid field in this JSON object.', 'messageParameters': [], 'recommendedActions': ['Check the valid fields for this JSON object and remove or correct the unrecognized field.'], 'errorSource': None, 'nestedErrors': [], 'data': {}})

column 11 points to 'enclosureTypeUri': '/rest/enclosure-types/SY12000' in the JSON as far as i can see.

Regards
Michael

@yuvirani
Copy link
Contributor

yuvirani commented Nov 4, 2020

@Georgimi, I'm sorry that still you are facing the issue. To see the changes in python module, we need to do the below steps:
$ git clone https://github.com/HewlettPackard/oneview-python.git
$ cd oneview-python
$ pip install hpeOneView

Please let us know if this helps.

@Georgimi
Copy link

Georgimi commented Nov 5, 2020

did that.
Collecting hpeOneView
Downloading hpeOneView-5.5.0.tar.gz (87 kB)
|████████████████████████████████| 87 kB 4.6 MB/s
Collecting future>=0.15.2
Downloading future-0.18.2.tar.gz (829 kB)
|████████████████████████████████| 829 kB 20.1 MB/s
Using legacy 'setup.py install' for hpeOneView, since package 'wheel' is not installed.
Using legacy 'setup.py install' for future, since package 'wheel' is not installed.
Installing collected packages: future, hpeOneView
Running setup.py install for future ... done
Running setup.py install for hpeOneView ... done
Successfully installed future-0.18.2 hpeOneView-5.5.0

Still not working for EGs.

Regards
Michael

@yuvirani
Copy link
Contributor

@Georgimi, EG creation is working fine in python without any issue, but its causing the problem in Ansible and I could reproduce the error in ansible. We are working on it, will update you once it is fixed.

@yuvirani
Copy link
Contributor

yuvirani commented Nov 26, 2020

@Georgimi,
We need to understand that whether this is python environment related issue as the latest code changes are not getting reflected. Hence we came up with the below mentioned solution after making further analysis.

Resolution Steps:

  • Switch to root user
  • Unset from PYTHONPATH environment variable if added already (unset PYTHONPATH)
  • pip uninstall hpeOneView
  • pip install hpeOneView (ensure latest changes are reflected in below mentioned path - /usr/local/lib/pythonX/dist-packages)

Please do check the paths depending on the python version you use.

  • pip ---> python2.7 (/usr/local/lib/python2.7/dist-packages)
  • pip3 ---> python3.6 (/usr/local/lib/python3.6/dist-packages)

Hopefully the above checks should help you resolve the issue.

@yuvirani yuvirani closed this as completed Dec 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants