[Kimchi-devel] [PATCH] Issue #365: Preventing duplicate Bridged VLAN tagged network.
Rodrigo Trujillo
rodrigo.trujillo at linux.vnet.ibm.com
Fri Apr 4 17:46:25 UTC 2014
Reviewed-by: Rodrigo Trujillo <rodrigo.trujillo at linux.vnet.ibm.com>
On 04/03/2014 05:32 PM, Paulo Vital wrote:
> While creating a Bridged VLAN tagged network using the same
> configuration of a previous network (destination and VLAN ID) but
> with different names, Kimchi allows the creation process.
>
> This patch prevents the creation of the second Bridged VLAN tagged
> network, checking if already has some network with the same bridge
> configured.
>
> https://github.com/kimchi-project/kimchi/issues/365
>
> Signed-off-by: Paulo Vital <pvital at linux.vnet.ibm.com>
> ---
> src/kimchi/model/networks.py | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/src/kimchi/model/networks.py b/src/kimchi/model/networks.py
> index 63f3136..8f77c12 100644
> --- a/src/kimchi/model/networks.py
> +++ b/src/kimchi/model/networks.py
> @@ -185,6 +185,11 @@ class NetworksModel(object):
> vlan_id)
> conn = self.conn.get()
>
> + if br_name in [net.bridgeName() for net in conn.listAllNetworks()]:
> + error_msg = 'The interface %s already exist' % br_name
> + raise InvalidOperation("KCHNET0010E", {'iface': br_name,
> + 'err': error_msg})
> +
> with RollbackContext() as rollback:
>
> try:
More information about the Kimchi-devel
mailing list