Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
18
Merge Requests
18
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
slapos.core
Commits
9d6bd566
Commit
9d6bd566
authored
Nov 30, 2018
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos.cli.boot: remove code duplication
parent
2a0975a2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
11 deletions
+4
-11
slapos/cli/boot.py
slapos/cli/boot.py
+4
-11
No files found.
slapos/cli/boot.py
View file @
9d6bd566
...
@@ -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
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment