Skip to content

Commit

Permalink
fix some bugs, remove vlans on test clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Bacho committed Oct 5, 2023
1 parent 5a16535 commit 016a141
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion plugins/module_utils/metal/metal_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ def get_assignment_address(resource: dict):
'metro': 'metro',
'contact_email': 'contact_email',
'description': optional_str('description'),
'mode': 'mode',
'mode': optional_str('mode'),
'redundancy': 'redundancy',
'tags': 'tags',
'type': 'type',
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/metal_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ def speed_str_to_int(module):

def determine_ic_submodule(module):
type = module.params["type"]
is_project = "project_id" in module.params
is_project = module.params.get("project_id")
vlans = module.params.get("vlans")
vrfs = module.params.get("vrfs")

Expand Down
2 changes: 1 addition & 1 deletion tests/integration/inventory
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[testgroup]
testhost ansible_connection="local" ansible_pipelining="yes" ansible_python_interpreter="/home/sani/code/pythonEnv/ans/bin/python"
testhost ansible_connection="local" ansible_pipelining="yes" ansible_python_interpreter="/usr/bin/python3"
12 changes: 12 additions & 0 deletions tests/integration/targets/metal_connection/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,18 @@
debug:
msg: "***** TESTING COMPLETE. COMMENCE TEARDOWN *****"

- name: list vlans
equinix.cloud.metal_vlan_info:
project_id: "{{ project.id }}"
register: vlan_info_listed

- name: delete vlans
equinix.cloud.metal_vlan:
id: "{{ item.id }}"
state: absent
loop: "{{ vlan_info_listed.resources }}"
ignore_errors: yes

- name: list test projects
equinix.cloud.metal_project_info:
name: "{{ test_prefix }}"
Expand Down

0 comments on commit 016a141

Please sign in to comment.