Skip to content

Fix ansible variable VM_targets undefined issue for ptf topology#4229

Merged
wangxin merged 1 commit intosonic-net:masterfrom
wangxin:fix-vm-targets
Sep 12, 2021
Merged

Fix ansible variable VM_targets undefined issue for ptf topology#4229
wangxin merged 1 commit intosonic-net:masterfrom
wangxin:fix-vm-targets

Conversation

@wangxin
Copy link
Collaborator

@wangxin wangxin commented Sep 10, 2021

Description of PR

Summary:
Fixes # (issue)

Type of change

  • Bug fix
  • Testbed and Framework(new/improvement)
  • Test case(new/improvement)

Back port request

  • 201911

Approach

What is the motivation for this PR?

PR #4156 replaced variable VM_hosts with VM_targets when call the
vm_topology module. With this change, the vm_topology module will
create bridges for VMs used by current testbed instead of create bridges
for all VMs available on the test server.

However, the change missed the ptf topology scenario. In case of
ptf topology, the VM_targets ansible variable is not defined. Calling
the vm_topology module will fail.

How did you do it?

The fix is to assign default value [] to VM_targets when it is not defined.

How did you verify/test it?

Test add-topo/remove-topo for ptf and t0 topologies.

Any platform specific information?

Supported testbed topology if it's a new test case?

Documentation

PR sonic-net#4156 replaced variable VM_hosts with VM_targets when call the
vm_topology module. With this change, the vm_topology will create
bridges for VMs used by current testbed instead of create bridges
for all VMs available on the test server.
However, the change missed the ptf topology scenario. In case of
ptf topology, the VM_targets ansible varialbe is not defined.

The fix is to assign default value `[]` to VM_targets when it is not
defined.

Signed-off-by: Xin Wang <[email protected]>
@wangxin wangxin requested a review from a team as a code owner September 10, 2021 08:17
@neethajohn
Copy link
Contributor

#4220 looks similar

@wangxin wangxin mentioned this pull request Sep 11, 2021
4 tasks
@wangxin wangxin merged commit 0b66a14 into sonic-net:master Sep 12, 2021
vmittal-msft pushed a commit to vmittal-msft/sonic-mgmt that referenced this pull request Sep 28, 2021
…ic-net#4229)

What is the motivation for this PR?
PR sonic-net#4156 replaced variable VM_hosts with VM_targets when call the
vm_topology module. With this change, the vm_topology module will
create bridges for VMs used by current testbed instead of create bridges
for all VMs available on the test server.

However, the change missed the ptf topology scenario. In case of
ptf topology, the VM_targets ansible variable is not defined. Calling
the vm_topology module will fail.

How did you do it?
The fix is to assign default value [] to VM_targets when it is not defined.

How did you verify/test it?
Test add-topo/remove-topo for ptf and t0 topologies.

Signed-off-by: Xin Wang <[email protected]>
@wangxin wangxin deleted the fix-vm-targets branch December 13, 2021 09:25
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

Successfully merging this pull request may close these issues.

4 participants