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

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