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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kristopher Ruzic
slapos.package
Commits
74ef042c
Commit
74ef042c
authored
Jun 28, 2013
by
Marco Mariani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
simpler getSlaposConfiguration()
parent
7f52951e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
15 deletions
+10
-15
slapprepare/slapprepare/slapprepare.py
slapprepare/slapprepare/slapprepare.py
+10
-15
No files found.
slapprepare/slapprepare/slapprepare.py
View file @
74ef042c
...
@@ -126,21 +126,16 @@ def get_yes_no(prompt, default=None):
...
@@ -126,21 +126,16 @@ def get_yes_no(prompt, default=None):
def
getSlaposConfiguration
(
slapos_configuration_file_path
=
None
):
def
getSlaposConfiguration
(
slapos_configuration_file_path
=
None
):
for
path
in
[
slapos_configuration_file_path
,
'/etc/opt/slapos/slapos.cfg'
,
'/etc/slapos/slapos.cfg'
]:
if
path
and
os
.
path
.
isfile
(
path
):
config
=
ConfigParser
.
RawConfigParser
()
config
=
ConfigParser
.
RawConfigParser
()
# Search slapos.cfg
config
.
read
(
path
)
if
not
slapos_configuration_file_path
:
slapos_configuration_file_path
=
"/etc/opt/slapos/slapos.cfg"
slapos_configuration_file_path_old
=
"/etc/slapos/slapos.cfg"
if
not
os
.
path
.
isfile
(
slapos_configuration_file_path
):
if
os
.
path
.
isfile
(
slapos_configuration_file_path_old
):
slapos_configuration_file_path
=
slapos_configuration_file_path_old
else
:
# No configuration found : returning
return
{}
# Reading slapos paths from configuration file
config
.
read
(
slapos_configuration_file_path
)
return
config
return
config
return
{}
# Return OpenSUSE version if it is SuSE
# Return OpenSUSE version if it is SuSE
...
...
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