fix(iputil): Do not use -e option for awk 18/42118/7
authorVratko Polak <[email protected]>
Thu, 9 Jan 2025 16:10:00 +0000 (17:10 +0100)
committerVratko Polak <[email protected]>
Thu, 9 Jan 2025 16:10:00 +0000 (17:10 +0100)
Probably another consequence of ubuntu2404 migration.
Nginx tests were failing (indirectly) due to "awk -e" failing.

Change-Id: I23ebc86de55e5301727f34c1337ed163ead1506c
Signed-off-by: Vratko Polak <[email protected]>
resources/libraries/python/IPUtil.py

index 309d824..32f510c 100644 (file)
@@ -1,5 +1,5 @@
-# Copyright (c) 2024 Cisco and/or its affiliates.
-# Copyright (c) 2024 PANTHEON.tech s.r.o.
+# Copyright (c) 2025 Cisco and/or its affiliates.
+# Copyright (c) 2025 PANTHEON.tech s.r.o.
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at:
@@ -498,7 +498,7 @@ class IPUtil:
         else:
             cmd = f"ip addr show dev {interface}"
 
-        cmd += u" | grep 'inet ' | awk -e '{print $2}'"
+        cmd += u" | grep 'inet ' | awk '{print $2}'"
         cmd += f" | grep '{ip_addr_with_prefix}'"
         _, stdout, _ = exec_cmd(node, cmd, timeout=5, sudo=True)