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
13
Merge Requests
13
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
slapos.package
Commits
95625c99
Commit
95625c99
authored
Sep 10, 2012
by
Cédric Le Ninivin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slaptest check if section are in slapos.cfg
slapos-start exit with 0 if no slapos.cfg is found
parent
b9beef3e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
22 deletions
+40
-22
slapos-node/slapos-start
slapos-node/slapos-start
+5
-0
slapos-node/slaptest
slapos-node/slaptest
+35
-22
No files found.
slapos-node/slapos-start
View file @
95625c99
...
...
@@ -7,6 +7,11 @@ IPV6WAITTIME=5
SLAPOS_CONFIGURATION
=
/etc/opt/slapos/
if
[
!
-f
$SLAPOS_CONFIGURATION
/slapos.cfg
]
;
then
echo
"No slapos.cfg found"
exit
0
fi
echo
"Starting slap script"
# Check ipv4
...
...
slapos-node/slaptest
View file @
95625c99
...
...
@@ -114,6 +114,7 @@ def check_networkcache(config,logger,configuration_parser
Check network cache download
"""
section
=
"networkcache"
if
configuration_parser
.
has_section
(
section
)
:
configuration_example_dict
=
dict
(
configuration_example_parser
.
items
(
section
))
configuration_dict
=
dict
(
configuration_parser
.
items
(
section
))
for
key
in
configuration_example_dict
:
...
...
@@ -133,6 +134,7 @@ def check_networkcache(config,logger,configuration_parser
if
config
.
check_upload
==
True
:
check_networkcache_upload
(
config
,
logger
,
configuration_dict
)
class
Upload
:
"""
Class used as a reference to check network cache upload
...
...
@@ -223,8 +225,19 @@ def slapos_conf_check (config):
configuration_example_parser
=
ConfigParser
.
RawConfigParser
()
configuration_example_parser
.
read
(
slapos_cfg_example
)
os
.
remove
(
slapos_cfg_example
)
# Check sections
mandatory_sections
=
[
"slapos"
,
"slapformat"
,
"networkcache"
]
for
section
in
mandatory_sections
:
if
not
configuration_parser
.
has_section
(
section
):
logger
.
critical
(
"No %s section in slapos.cfg"
%
section
)
mandatory_sections
.
remove
(
section
)
if
'networkcache'
in
mandatory_sections
:
mandatory_sections
.
remove
(
'networkcache'
)
# Check if parameters for slapos and slapformat exists
for
section
in
(
"slapos"
,
"slapformat"
)
:
for
section
in
mandatory_sections
:
configuration_dict
=
dict
(
configuration_parser
.
items
(
section
))
configuration_example_dict
=
dict
(
configuration_example_parser
.
items
(
section
))
for
key
in
configuration_example_dict
:
...
...
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