HewlettPackard / oneview-ansible

This project is no longer being developed and has limited support. Please use the newer Ansible Collection project: https://github.com/HewlettPackard/oneview-ansible-collection
Apache License 2.0
104 stars 65 forks source link

Task monitor is not working #479

Closed fideltak closed 4 years ago

fideltak commented 4 years ago

Scenario/Intent

When I try to create some networks by using oneview_ethernet_network, an error is occurred from ansible oneview module. However these networks looks created normally in Oneview GUI.

ine 254, in get_associated_resource
    raise HPOneViewInvalidResource(MSG_TASK_TYPE_UNRECONIZED % task['type'])
hpOneView.exceptions.HPOneViewInvalidResource: Task type: 'TaskResourceV3' resource is not a recognized version

is this caused from Python SDK?
https://github.com/HewlettPackard/python-hpOneView/blob/release/5.0.0-beta/hpOneView/resources/task_monitor.py#L243-L244

       if task['type'] == 'TaskResourceV2':
            resource_uri = task['associatedResource']['resourceUri']

Environment Details

Steps to Reproduce

Execute playbook like below. [Playbook]

  tasks:
    - name: "Create some networks"
      oneview_ethernet_network:
        hostname: "{{ ov_hostname }}"
        username: "{{ ov_username }}"
        password: "{{ ov_password }}"
        api_version: "{{ ov_api_ver }}"
        state: present
        data:
          namePrefix: 'tak_test'
          purpose: 'General'
          vlanIdRange: '202-203,501'
          type: 'bulk-ethernet-networkV2'
          smartLink: true
          privateNetwork: false

Expected Result

I expect to get return code "OK" from Ansible.

Actual Result

error.

sijeesh commented 4 years ago

@fideltak , You are using the deprecated SDK. We have a new SDK released with code refactoring for adding more helper methods into the resource classes. https://github.com/HewlettPackard/oneview-python

Always, run "pip install -r requiremetns.txt"(available in the root directory of the repository) to install the dependency packages of OneView-Ansible modules. requirements.txt is up to date with the OneView-Python SDK version required for the Ansible repository.

fideltak commented 4 years ago

@sijeesh Thanks, it is working well after re-install SDK. I did not realize that SDK repo was changed. https://github.com/HewlettPackard/oneview-python