HewlettPackard / oneview-ansible-collection

Ansible Collection and Sample Playbooks for HPE OneView

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

oneview_logical_interconnect_group.py does not handle empty uplinksets

frippe75 opened this issue · comments

Created an empty uplinkset named 'Test'

Then went on to try to add some new networks to that LIG and the new Uplinkset.

      oneview_logical_interconnect_group:
        config: "{{ config }}"
        state: present
        data:
          name: 'LIG1'
          enclosureType: 'SY12000'
          uplinkSets:
            - name: 'Test'
              mode: 'Auto'
              networkType: 'Ethernet'
              networkNames:
                - 'VLAN_1100'
                - 'VLAN_1101'

It error out on:

/ansible_collections/hpe/oneview/plugins/modules/oneview_logical_interconnect_group.py\", line 323, in __replace_uplinkset_port_values\nTypeError: 'NoneType' object is not iterable\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error"

Looking at the source code

for uplinkSet in self.data['uplinkSets']:
                    existingLogicalPortConfigInfos = uplinkSet.get('logicalPortConfigInfos')
                    for item in existingLogicalPortConfigInfos:

Looks like the uplinkSet.get('logicalPortConfigInfos') returns nothing. Maybe check for this and handle accordingly?

Hi Fredrick,

We will check on this and get back to you.

Thanks

Hi Fredrick,

We have added this issue to our work item and would be available part of OV8.0 release.

Hi, so in the meantime is there a workaround?
Working for a HPE Global 100 account and need to automate a few things. So is it enough to do a get of the full object and parse out the uplinkset and merge in my own data?