[Kimchi-devel] [PATCH] [Kimchi] Bug fix: Set original VLAN device to network parameters to be updated

Aline Manera posted 1 patch 7 years, 7 months ago
Failed in applying to current master (apply log)
model/networks.py | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
[Kimchi-devel] [PATCH] [Kimchi] Bug fix: Set original VLAN device to network parameters to be updated
Posted by Aline Manera 7 years, 7 months ago
It is part of the #1087 fix

Signed-off-by: Aline Manera <alinefm@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
-- 
2.9.3

_______________________________________________
Kimchi-devel mailing list
Kimchi-devel@ovirt.org
http://lists.ovirt.org/mailman/listinfo/kimchi-devel
Re: [Kimchi-devel] [PATCH] [Kimchi] Bug fix: Set original VLAN device to network parameters to be updated
Posted by Daniel Henrique Barboza 7 years, 7 months ago
Reviewed-by: Daniel Barboza <danielhb@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@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

_______________________________________________
Kimchi-devel mailing list
Kimchi-devel@ovirt.org
http://lists.ovirt.org/mailman/listinfo/kimchi-devel
Re: [Kimchi-devel] [PATCH] [Kimchi] Bug fix: Set original VLAN device to network parameters to be updated
Posted by Aline Manera 7 years, 7 months ago
Applied. Thanks.

Regards,

Aline Manera

_______________________________________________
Kimchi-devel mailing list
Kimchi-devel@ovirt.org
http://lists.ovirt.org/mailman/listinfo/kimchi-devel