[Kimchi-devel] [PATCH] [Kimchi] Bug fix: Set original VLAN device to network parameters to be updated
Daniel Henrique Barboza
danielhb at linux.vnet.ibm.com
Wed Mar 29 13:44:16 UTC 2017
Reviewed-by: Daniel Barboza <danielhb at linux.vnet.ibm.com>
On 03/29/2017 10:25 AM, Aline Manera wrote:
> It is part of the #1087 fix
>
> Signed-off-by: Aline Manera <alinefm at linux.vnet.ibm.com>
> ---
> model/networks.py | 10 ++++------
> 1 file changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/model/networks.py b/model/networks.py
> index eb1590e..ce93bb1 100644
> --- a/model/networks.py
> +++ b/model/networks.py
> @@ -532,6 +532,9 @@ class NetworkModel(object):
> if params.get('vlan_id') or params.get('interfaces'):
> raise InvalidParameter("KCHNET0032E")
>
> + # merge parameters
> + info.update(params)
> +
> # get target device if bridge was created by Kimchi
> if connection == 'bridge':
> iface = info['interfaces'][0]
> @@ -544,18 +547,13 @@ class NetworkModel(object):
> else:
> info['interfaces'] = original['interfaces'] = [port]
>
> - # merge parameters
> - info.update(params)
> -
> # delete original network
> self.delete(name)
>
> try:
> # create new network
> - network = self.collection.create(info)
> + return self.collection.create(info)
> except:
> # restore original network
> self.collection.create(original)
> raise
> -
> - return network
More information about the Kimchi-devel
mailing list