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
Ivan Tyagov
slapos.package
Commits
d9860649
Commit
d9860649
authored
Mar 07, 2013
by
Cédric de Saint Martin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix way of getting computer_id
parent
754e4d30
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
8 deletions
+3
-8
slapprepare/slapprepare/slapprepare.py
slapprepare/slapprepare/slapprepare.py
+3
-8
No files found.
slapprepare/slapprepare/slapprepare.py
View file @
d9860649
...
...
@@ -152,14 +152,9 @@ def suse_version():
# Parse certificate to get computer name and return it
def
get_computer_name
(
slapos_configuration
):
try
:
conf_file
=
open
(
slapos_configuration
,
"r"
)
for
line
in
conf_file
:
line
=
line
.
rstrip
(
'
\
n
'
)
if
"computer_id"
in
line
:
i
=
line
.
find
(
"COMP-"
)
conf_file
.
close
()
return
line
[
i
:]
except
IOError
:
return
getSlaposConfiguration
(
slapos_configuration
).
get
(
'slapos'
,
'computer_id'
)
except
:
print
"Warning: slapos.cfg doesn't exist. Using current hostname."
return
socket
.
gethostname
()
...
...
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