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
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
Léo-Paul Géneau
slapos.core
Commits
507a5eb6
Commit
507a5eb6
authored
Jul 12, 2011
by
Arnaud Fontaine
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert
93ec8ed4
as only key_file and cert_file from slapconsole section is used.
parent
b80a2195
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
9 deletions
+11
-9
slapos/console.py
slapos/console.py
+11
-9
No files found.
slapos/console.py
View file @
507a5eb6
...
...
@@ -91,22 +91,24 @@ class Config:
configuration_parser
=
ConfigParser
.
SafeConfigParser
()
configuration_parser
.
read
(
configuration_file_path
)
# Merges the arguments and configuration
for
section
in
(
'slapos'
,
'slapconsole'
):
try
:
configuration_dict
=
dict
(
configuration_parser
.
items
(
section
))
configuration_dict
=
dict
(
configuration_parser
.
items
(
"slapconsole"
))
except
ConfigParser
.
NoSectionError
:
pass
else
:
for
key
in
configuration_dict
:
if
not
getattr
(
self
,
key
,
None
):
setattr
(
self
,
key
,
configuration_dict
[
key
])
master_url
=
getattr
(
self
,
'master_url'
,
None
)
configuration_dict
=
dict
(
configuration_parser
.
items
(
'slapos'
))
master_url
=
configuration_dict
.
get
(
'master_url'
,
None
)
if
not
master_url
:
raise
ValueError
(
"No option 'master_url'"
)
elif
master_url
.
startswith
(
'https'
)
and
\
not
getattr
(
self
,
'key_file'
,
None
)
and
\
not
getattr
(
self
,
'cert_file'
,
None
):
raise
ValueError
(
"No option 'key_file' and/or 'cert_file'"
)
else
:
setattr
(
self
,
'master_url'
,
master_url
)
def
init
(
config
):
...
...
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