Skip to content

Commit

Permalink
Update hyperv.py
Browse files Browse the repository at this point in the history
  • Loading branch information
SRIKKANTH committed Jan 29, 2025
1 parent 329ea56 commit 5f5fc73
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lisa/tools/hyperv.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,13 +336,13 @@ def delete_nat_mapping(
elif internal_ip is not None:
mapping_id = self.node.tools[PowerShell].run_cmdlet(
f"Get-NetNatStaticMapping | "
f"Where-Object {{$_.InternalIPAddress -eq {internal_ip}}}"
f"Where-Object {{$_.InternalIPAddress -eq '{internal_ip}'}}"
f" | Select-Object -ExpandProperty StaticMappingID",
force_run=True,
)
external_port = self.node.tools[PowerShell].run_cmdlet(
f"Get-NetNatStaticMapping | "
f"Where-Object {{$_.InternalIPAddress -eq {internal_ip}}}"
f"Where-Object {{$_.InternalIPAddress -eq '{internal_ip}'}}"
f" | Select-Object -ExpandProperty ExternalPort",
force_run=True,
)
Expand All @@ -354,7 +354,7 @@ def delete_nat_mapping(
force_run=True,
)
if external_port:
self._release_nat_port(external_port)
self._release_nat_port(int(external_port))
else:
self._log.debug(f"Mapping for port {external_port} does not exist")

Expand Down

0 comments on commit 5f5fc73

Please sign in to comment.