Skip to content
This repository has been archived by the owner on Mar 6, 2024. It is now read-only.

Fixing error in list_nics(self): primary_index referenced before assignment #696

Merged

Conversation

westsouthnight
Copy link
Contributor

@westsouthnight westsouthnight commented Jul 26, 2020

Issue details:

When we use Ansible VMware vCloud Director modules from:

https://github.com/vmware/ansible-module-vcloud-director

When we add_nic() are first, after successful complete adding module fail with error about referenced variable which called before assigment.

Description of proposed changes in the PR:

  • For prevention that need to add self.instance call and declaration for case when its are a first adapter provided by add_nic calls from ansible.

Detailed description of proposed changes:

When we use Ansible Module, and inside Ansible module calling list_nics() on adding time (list_nics called afer add_nic), we crash after successful adding the NIC - Fatal error, what try to say about first added NIC and him "primary_index", which referenced before assignment.

This issue blocks fix Ansible module in child repository

feat2RFC(vcd_vapp_vm_nic): Do a module invocation better #131

Example of exception:

gist_exception_example

Снимок экрана 2020-07-26 в 23 05 59


This change is Reviewable

When we use https://github.com/vmware/ansible-module-vcloud-director,
and inside ansible modules calling list nics on adding time, we get after add the error which say about "primary_index" referenced before assignment.
when we call it from ansible by https://github.com/vmware/ansible-module-vcloud-director -

https://gist.github.com/westsouthnight/04f19ac37ec229df9921d380f67080b1

For prevention that need to add self.instance call and declaration for case when its are a first adapter provided by add_nic calls from ansible.
@westsouthnight
Copy link
Contributor Author

Somebody please review, @rocknes @sakthisunda please, i don't wants to place copy of that class with fix to my codebase.

@westsouthnight
Copy link
Contributor Author

@westsouthnight
Copy link
Contributor Author

UP!

@westsouthnight
Copy link
Contributor Author

Please, dear community and all devs! Please, if it possible look to this, really, little but big problem - which we can resolve now and close Issue faster then speed of light - merge that PR. No want stack on stuck after so long investigation, asking to your hearts, please without regredness. ASAP!

Copy link
Contributor

@shashim22 shashim22 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 1 of 1 files at r1.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants