Skip to content

Commit

Permalink
Bug fix: Set original VLAN device to network parameters to be updated
Browse files Browse the repository at this point in the history
It is part of the #1087 fix

Signed-off-by: Aline Manera <[email protected]>
  • Loading branch information
alinefm committed Mar 29, 2017
1 parent 62cb580 commit c49cbb5
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions model/networks.py
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,9 @@ def update(self, name, params):
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]
Expand All @@ -542,18 +545,13 @@ def update(self, name, params):
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

0 comments on commit c49cbb5

Please sign in to comment.