Skip to content

Commit 034160a

Browse files
committed
fix
Signed-off-by: Abhishek Kumar <[email protected]>
1 parent b809e89 commit 034160a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

python/lib/cloudutils/networkConfig.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,10 @@ def getDevInfo(dev):
153153
if line.find("HWaddr") != -1:
154154
macAddr = line.split("HWaddr ")[1].strip(" ")
155155
elif line.find("inet ") != -1:
156-
m = re.search("addr:(.*)\ *Bcast:(.*)\ *Mask:(.*)", line)
156+
m = re.search(r"addr:([^\s]+)\s*Bcast:([^\s]+)\s*Mask:([^\s]+)", line)
157157
if m is not None:
158-
ipAddr = m.group(1).rstrip(" ")
159-
netmask = m.group(3).rstrip(" ")
158+
ipAddr = m.group(1).strip()
159+
netmask = m.group(3).strip()
160160

161161
if networkConfig.isBridgePort(dev):
162162
type = "brport"

0 commit comments

Comments
 (0)