Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
snf-ganeti
Commits
78f66a17
Commit
78f66a17
authored
Jan 27, 2009
by
Guido Trotter
Browse files
Xen: use utils.Readfile to read the VNC password
Also raise HypervisorError rather than OpExecError. Reviewed-by: iustinp
parent
332d0e37
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/hypervisor/hv_xen.py
View file @
78f66a17
...
...
@@ -587,14 +587,10 @@ class XenHvmHypervisor(XenHypervisor):
config
.
write
(
"vncunused = 1
\n
"
)
try
:
password_file
=
open
(
constants
.
VNC_PASSWORD_FILE
,
"r"
)
try
:
password
=
password_file
.
readline
()
finally
:
password_file
.
close
()
except
IOError
:
raise
errors
.
OpExecError
(
"failed to open VNC password file %s "
%
constants
.
VNC_PASSWORD_FILE
)
password
=
utils
.
ReadFile
(
constants
.
VNC_PASSWORD_FILE
)
except
EnvironmentError
,
err
:
raise
errors
.
HypervisorError
(
"Failed to open VNC password file %s: %s"
%
(
constants
.
VNC_PASSWORD_FILE
,
err
))
config
.
write
(
"vncpasswd = '%s'
\n
"
%
password
.
rstrip
())
...
...
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