aristanetworks / ansible-cvp

Ansible modules for Arista CloudVision
http://cvp.avd.sh
Apache License 2.0
66 stars 61 forks source link

Fix(cv_container_v3): check_mode error #584

Closed sugetha24 closed 1 year ago

sugetha24 commented 1 year ago

Change Summary

Running cv_container_v3 with --check is throwing an error: TypeError: string indices must be integers

Related Issue(s)

Fixes #582

Component(s) name

arista.cvp.cv_container_v3

How to test

---
- name: cv_container_v3
  hosts: CloudVision
  connection: local
  gather_facts: no
  check_mode: True
  vars:
    CVP_CONTAINERS:
      Sugetha:
        parentContainerName: Tenant
      TestCreate:
        parentContainerName: Sugetha

  tasks:
    - name: "Configure containers on {{inventory_hostname}}"
      arista.cvp.cv_container_v3:
        topology: "{{CVP_CONTAINERS}}"
        state: present
        apply_mode: loose

Output:

changed: [CloudVision] => changed=true 
  configlets_attached:
    changed: false
    configlets_attached_count: 0
    configlets_attached_list: []
    diff: {}
    success: false
    taskIds: []
  configlets_detached:
    changed: false
    configlets_detached_count: 0
    configlets_detached_list: []
    diff: {}
    success: true
    taskIds: []
  container_added:
    changed: true
    container_added_count: 1
    container_added_list:
    - TestCreate
    diff: {}
    success: true
    taskIds: []
  container_deleted:
    changed: false
    container_deleted_count: 0
    container_deleted_list: []
    diff: {}
    success: false
    taskIds: []
  success: true
  taskIds: []

Checklist

Repository Checklist