ScaleComputing / HyperCoreAnsibleCollection

Official Ansible collection for Scale Computing SC//HyperCore (HC3) v1 API
GNU General Public License v3.0
12 stars 8 forks source link

Refactor Nic._handle_nic_type method #188

Closed justinc1 closed 1 year ago

justinc1 commented 1 year ago

Draft: this requires #187 to be merged first - only last commit in refactor-NicType branch is relevant.

The Nic._handle_nic_type method implemented conversion of NIC type from hypercore to ansible. But in code it was used also to "convert" from ansible to ansible - whis was wrong. Unittest did pass because we had also wrong unittest data - mock data pretended HyperCore returns "virtio", but in reality "VIRTIO" is returned.

This is now changed, unittest mock data is fixed, and Nic._handle_nic_type is replaced with NicType.hypercore_to_ansible.