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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Nicolas Wavrant
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():
...
@@ -152,14 +152,9 @@ def suse_version():
# Parse certificate to get computer name and return it
# Parse certificate to get computer name and return it
def
get_computer_name
(
slapos_configuration
):
def
get_computer_name
(
slapos_configuration
):
try
:
try
:
conf_file
=
open
(
slapos_configuration
,
"r"
)
return
getSlaposConfiguration
(
slapos_configuration
).
get
(
'slapos'
,
for
line
in
conf_file
:
'computer_id'
)
line
=
line
.
rstrip
(
'
\
n
'
)
except
:
if
"computer_id"
in
line
:
i
=
line
.
find
(
"COMP-"
)
conf_file
.
close
()
return
line
[
i
:]
except
IOError
:
print
"Warning: slapos.cfg doesn't exist. Using current hostname."
print
"Warning: slapos.cfg doesn't exist. Using current hostname."
return
socket
.
gethostname
()
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