'ip addr show label' command returns vlan interfaces in an unusable format
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Charm Helpers |
Fix Released
|
Medium
|
Jorge Niedbalski |
Bug Description
the 'ip addr show label' command the charm uses displays vlan interfaces on bonds in the following format which is not able to used, for example bond0.10@bond0, when we just want bond0.10. The next step should be to open the bug against the quantum-gateway charm for this issue.
$ ip addr show label bond0.10
6: bond0.10@bond0: <BROADCAST,
link/ether 08:00:27:16:b9:5f brd ff:ff:ff:ff:ff:ff
inet 10.0.0.1/24 brd 10.0.0.255 scope global bond0.10
valid_lft forever preferred_lft forever
inet6 fe80::a00:
valid_lft forever preferred_lft forever
The following patch is what we used to split "bond0.10@bond0" on '@' and only return the first field "bond0.10"
=== modified file 'hooks/
--- hooks/charmhelp
+++ hooks/charmhelp
@@ -13,6 +13,7 @@
import subprocess
import hashlib
import apt_pkg
+import re
from collections import OrderedDict
@@ -281,7 +282,11 @@
ip_output = (line for line in ip_output if line)
for line in ip_output:
if line.split(
- interfaces.
+ if re.search('@', line):
+ interfaces.
+ else:
+ interfaces.
return interfaces
Related branches
- Matt Bruzek: Approve
- Jorge Niedbalski (community): Approve
-
Diff: 74 lines (+20/-12)3 files modifiedREADME.test (+3/-11)
charmhelpers/core/host.py (+6/-1)
tests/core/test_host.py (+11/-0)
description: | updated |
description: | updated |
Changed in charm-helpers: | |
status: | New → Confirmed |
assignee: | nobody → Jorge Niedbalski (niedbalski) |
importance: | Undecided → Medium |
status: | Confirmed → Fix Committed |
Changed in charm-helpers: | |
status: | Fix Committed → Fix Released |