Verified Commit 06eb748c authored by Loïc Dachary's avatar Loïc Dachary Committed by Loïc Dachary

enough: the network never changes when the stack is updated

There is no need to call create_or_update again because the primary
network is always the same and the secondary network is not known
to the stack.
parent 3eb57b8b
......@@ -100,10 +100,13 @@ class Stack(OpenStackBase):
def create_or_update(self, return_on_create=False):
if self.definition['name'] not in self.list():
self.create()
info = self.create()
if return_on_create:
return None
info = self.update()
else:
info = self._create_or_update('update', 'Ext-Net')
self.create_internal_network()
self.connect_internal_network()
if not self.only_internal() or self.args.get('route_to_internal', True):
self.wait_for_ssh(info['ipv4'], info['port'])
Hosts(self.config_dir).create_or_update(
......@@ -124,23 +127,18 @@ class Stack(OpenStackBase):
return
self.o.server.add.network(server, network)
def update(self):
self.create_internal_network()
r = self._create_or_update('update', self.definition.get('network', 'Ext-Net'))
self.connect_internal_network()
return r
def only_internal(self):
return self.definition.get('network_internal_only', False)
def create(self):
try:
log.info('create on network Ext-Net')
log.info('create or update')
info = self._create_or_update('create', 'Ext-Net')
except sh.ErrorReturnCode_1:
log.info('retry create on network Ext-Net')
log.info('retry create or update')
# retry once because there is no way to increase the timeout and create fails often
info = self._create_or_update('update', 'Ext-Net')
return info
def delete_no_wait(self):
name = self.definition['name']
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment