Commit 9d6bd566 authored by Julien Muchembled's avatar Julien Muchembled

slapos.cli.boot: remove code duplication

parent 2a0975a2
...@@ -159,11 +159,8 @@ class BootCommand(ConfigCommand): ...@@ -159,11 +159,8 @@ class BootCommand(ConfigCommand):
master_hostname = master_url.hostname master_hostname = master_url.hostname
# Check that we have IPv6 ready # Check that we have IPv6 ready
if configp.get('slapformat','ipv6_interface'): _waitIpv6Ready(configp.get('slapformat', 'ipv6_interface') or
interface_name = configp.get('slapformat','ipv6_interface') configp.get('slapformat', 'interface_name'))
else:
interface_name = configp.get('slapformat','interface_name')
_waitIpv6Ready(interface_name)
# Check that node can ping master # Check that node can ping master
if valid_ipv4(master_hostname): if valid_ipv4(master_hostname):
...@@ -176,17 +173,13 @@ class BootCommand(ConfigCommand): ...@@ -176,17 +173,13 @@ class BootCommand(ConfigCommand):
app = SlapOSApp() app = SlapOSApp()
# Make sure slapos node format returns ok # Make sure slapos node format returns ok
is_ready = _runFormat(app) while not _runFormat(app):
while is_ready == 0:
print "[BOOT] [ERROR] Fail to format, try again in 15 seconds..." print "[BOOT] [ERROR] Fail to format, try again in 15 seconds..."
sleep(15) sleep(15)
is_ready = _runFormat(app)
# Make sure slapos node bang returns ok # Make sure slapos node bang returns ok
is_ready = _runBang(app) while not _runBang(app):
while is_ready == 0:
print "[BOOT] [ERROR] Fail to bang, try again in 15 seconds..." print "[BOOT] [ERROR] Fail to bang, try again in 15 seconds..."
sleep(15) sleep(15)
is_ready = _runBang(app)
_removeTimestamp(instance_root) _removeTimestamp(instance_root)
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