Signed-off-by: Ramon Medeiros <ramonn(a)linux.vnet.ibm.com>
To avoid issue #556: Unable to create bridge virbr0: File already exists, which
happens because libvirt uses virbr0 as default bridge to create a
network pool. When this bridge is already created, libvirt raises and
error.
To fix, it will be passed an available bridge, that will be created by
libvirt.
---
src/kimchi/model/networks.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/kimchi/model/networks.py b/src/kimchi/model/networks.py
index dd8e66c..a3d350c 100644
--- a/src/kimchi/model/networks.py
+++ b/src/kimchi/model/networks.py
@@ -52,7 +52,8 @@ class NetworksModel(object):
try:
subnet = self._get_available_address(knetwork.DefaultNetsPool)
params = {"name": "default", "connection":
"nat",
- "subnet": subnet}
+ "subnet": subnet,
+ "bridge":
self._find_bridge_available("virbr")}
self.create(params)
return conn.networkLookupByName("default")
except Exception as e:
--
1.8.3.1