Revision 78f66a17 lib/hypervisor/hv_xen.py
b/lib/hypervisor/hv_xen.py | ||
---|---|---|
587 | 587 |
config.write("vncunused = 1\n") |
588 | 588 |
|
589 | 589 |
try: |
590 |
password_file = open(constants.VNC_PASSWORD_FILE, "r") |
|
591 |
try: |
|
592 |
password = password_file.readline() |
|
593 |
finally: |
|
594 |
password_file.close() |
|
595 |
except IOError: |
|
596 |
raise errors.OpExecError("failed to open VNC password file %s " % |
|
597 |
constants.VNC_PASSWORD_FILE) |
|
590 |
password = utils.ReadFile(constants.VNC_PASSWORD_FILE) |
|
591 |
except EnvironmentError, err: |
|
592 |
raise errors.HypervisorError("Failed to open VNC password file %s: %s" % |
|
593 |
(constants.VNC_PASSWORD_FILE, err)) |
|
598 | 594 |
|
599 | 595 |
config.write("vncpasswd = '%s'\n" % password.rstrip()) |
600 | 596 |
|
Also available in: Unified diff