Last change
on this file since 1413 was
1413,
checked in by broder, 16 years ago
|
In invirt-vnc-client, get certificates from remctl, instead of from
the filesystems
|
-
Property svn:executable set to
*
|
File size:
983 bytes
|
Rev | Line | |
---|
[1413] | 1 | #!/usr/bin/python |
---|
[1336] | 2 | |
---|
[1413] | 3 | from invirt.config import structs as config |
---|
| 4 | from subprocess import Popen, call, PIPE |
---|
| 5 | import tempfile |
---|
| 6 | import os |
---|
| 7 | import sys |
---|
| 8 | import shutil |
---|
[1336] | 9 | |
---|
[1413] | 10 | def main(): |
---|
| 11 | subprocess.call(['kinit', '-k', 'daemon/%s' % config.web.hostname]) |
---|
| 12 | |
---|
| 13 | temp_dir = tempfile.mkdtemp() |
---|
| 14 | keystore = os.path.join(temp_dir, 'trust.store') |
---|
| 15 | for host in config.hosts: |
---|
| 16 | cert = subprocess.Popen(['remctl', config.remote.hostname, 'web', |
---|
| 17 | 'vnccert', host.hostname], |
---|
| 18 | stdout=PIPE) |
---|
| 19 | cert.wait() |
---|
| 20 | subprocess.call(['keytool', '-import', '-noprompt', '-alias', |
---|
| 21 | host.hostname, '-keystore', keystore, '-storepass', |
---|
| 22 | 'foobar'], stdin=cert.stdout) |
---|
| 23 | |
---|
| 24 | subprocess.call(['jar', 'uf', '/usr/share/invirt-vnc-client/VncViewer.jar', |
---|
| 25 | '-C', temp_dir, 'trust.store']) |
---|
| 26 | |
---|
| 27 | shutil.rmtree(temp_dir) |
---|
[1336] | 28 | |
---|
[1413] | 29 | if __name__ == '__main__': |
---|
| 30 | sys.exit(main()) |
---|
Note: See
TracBrowser
for help on using the repository browser.