We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b809e89 commit 034160aCopy full SHA for 034160a
python/lib/cloudutils/networkConfig.py
@@ -153,10 +153,10 @@ def getDevInfo(dev):
153
if line.find("HWaddr") != -1:
154
macAddr = line.split("HWaddr ")[1].strip(" ")
155
elif line.find("inet ") != -1:
156
- m = re.search("addr:(.*)\ *Bcast:(.*)\ *Mask:(.*)", line)
+ m = re.search(r"addr:([^\s]+)\s*Bcast:([^\s]+)\s*Mask:([^\s]+)", line)
157
if m is not None:
158
- ipAddr = m.group(1).rstrip(" ")
159
- netmask = m.group(3).rstrip(" ")
+ ipAddr = m.group(1).strip()
+ netmask = m.group(3).strip()
160
161
if networkConfig.isBridgePort(dev):
162
type = "brport"
0 commit comments