Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.package
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Łukasz Nowak
slapos.package
Commits
e56e090c
Commit
e56e090c
authored
Apr 15, 2013
by
Cédric de Saint Martin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
State that it is not possible to continue without slapos configuration.
parent
f5fb3b53
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
5 deletions
+17
-5
slapprepare/slapprepare/slapprepare.py
slapprepare/slapprepare/slapprepare.py
+17
-5
No files found.
slapprepare/slapprepare/slapprepare.py
View file @
e56e090c
...
@@ -443,12 +443,22 @@ class Config:
...
@@ -443,12 +443,22 @@ class Config:
def
userConfig
(
self
):
def
userConfig
(
self
):
# XXX-Testme: test each possible scenario
already_configured
=
getSlaposConfiguration
()
self
.
certificates
=
get_yes_no
(
"Automatically register new computer to slapos.org?"
,
True
)
self
.
certificates
=
get_yes_no
(
"Automatically register new computer to slapos.org?"
,
True
)
if
self
.
certificates
:
if
self
.
certificates
:
if
already_configured
:
if
not
get_yes_no
(
"A SlapOS Node configuration has been found. Do you want to overwrite it?"
,
False
):
print
"Okay, let's start from scratch."
return
False
self
.
computer_name
=
raw_input
(
"Define a unique name for this computer: "
)
self
.
computer_name
=
raw_input
(
"Define a unique name for this computer: "
)
self
.
partition_amount
=
raw_input
(
"""Number of SlapOS partitions for this computer? Default is 20 :"""
)
self
.
partition_amount
=
raw_input
(
"""Number of SlapOS partitions for this computer? Default is 20 :"""
)
if
self
.
partition_amount
==
''
:
if
self
.
partition_amount
==
''
:
self
.
partition_amount
=
'20'
self
.
partition_amount
=
'20'
elif
not
already_configured
:
print
"No existing Node configuration has been found. please either automatically register or manually setup Node configuration."
print
"Starting from scratch..."
return
False
self
.
virtual
=
get_yes_no
(
"Is this a virtual Machine?"
,
False
)
self
.
virtual
=
get_yes_no
(
"Is this a virtual Machine?"
,
False
)
if
not
self
.
virtual
:
if
not
self
.
virtual
:
...
@@ -466,6 +476,8 @@ class Config:
...
@@ -466,6 +476,8 @@ class Config:
self
.
ipv6_interface
=
""
self
.
ipv6_interface
=
""
self
.
need_ssh
=
get_yes_no
(
"Do you want a remote ssh access?"
,
True
)
self
.
need_ssh
=
get_yes_no
(
"Do you want a remote ssh access?"
,
True
)
return
True
def
displayUserConfig
(
self
):
def
displayUserConfig
(
self
):
if
self
.
certificates
:
if
self
.
certificates
:
...
@@ -489,7 +501,7 @@ def prepare_from_scratch(config):
...
@@ -489,7 +501,7 @@ def prepare_from_scratch(config):
os
.
mkdir
(
temp_directory
,
0711
)
os
.
mkdir
(
temp_directory
,
0711
)
while
True
:
while
True
:
config
.
userConfig
()
if
config
.
userConfig
():
print
"
\
n
This is your configuration:
\
n
"
print
"
\
n
This is your configuration:
\
n
"
config
.
displayUserConfig
()
config
.
displayUserConfig
()
if
get_yes_no
(
"
\
n
Do you confirm?"
):
if
get_yes_no
(
"
\
n
Do you confirm?"
):
...
...
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