model/networks.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)
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
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
Applied. Thanks. Regards, Aline Manera _______________________________________________ Kimchi-devel mailing list Kimchi-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/kimchi-devel
© 2016 - 2024 Red Hat, Inc.