File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
cloudshell/cp/vcenter/actions Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 1111)
1212
1313from cloudshell .cp .vcenter .actions .vm_network import VMNetworkActions
14+ from cloudshell .cp .vcenter .constants import IPProtocol
1415from cloudshell .cp .vcenter .exceptions import VMIPNotFoundException
1516from cloudshell .cp .vcenter .handlers .si_handler import SiHandler
1617from cloudshell .cp .vcenter .handlers .vm_handler import PowerState , VmHandler
@@ -86,12 +87,16 @@ def _prepare_vm_network_data(
8687 vlan_id = vm .get_network_vlan_id (network )
8788
8889 if vlan_id and (self .is_quali_network (network .name ) or is_predefined ):
89- vnic_ip = vnic .ipv4
90+ if app_model .ip_protocol_version == IPProtocol .IPv6 :
91+ vnic_ip = vnic .ipv6
92+ else :
93+ vnic_ip = vnic .ipv4
94+
9095 is_primary = primary_ip == vnic_ip if primary_ip else False
9196
9297 network_data = [
93- VmDetailsProperty (key = "IP" , value = vnic_ip ),
94- VmDetailsProperty (key = "IPv6" , value = vnic_ip ),
98+ VmDetailsProperty (key = "IP" , value = vnic . ipv4 ),
99+ VmDetailsProperty (key = "IPv6" , value = vnic . ipv6 ),
95100 VmDetailsProperty (key = "MAC Address" , value = vnic .mac_address ),
96101 VmDetailsProperty (key = "Network Adapter" , value = vnic .name ),
97102 VmDetailsProperty (key = "Port Group Name" , value = network .name ),
You can’t perform that action at this time.
0 commit comments