source: trunk/packages/invirt-vnc-client/debian/invirt-update-vnc-cert @ 1415

Last change on this file since 1415 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
RevLine 
[1413]1#!/usr/bin/python
[1336]2
[1413]3from invirt.config import structs as config
4from subprocess import Popen, call, PIPE
5import tempfile
6import os
7import sys
8import shutil
[1336]9
[1413]10def 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]29if __name__ == '__main__':
30    sys.exit(main())
Note: See TracBrowser for help on using the repository browser.