3 from invirt.config import structs as config
4 from subprocess import Popen, check_call, PIPE, CalledProcessError
10 def check_wait(popen):
11 retcode = popen.wait()
13 raise CalledProcessError(retcode, popen.pid)
17 check_call(['kinit', '-k', 'daemon/%s' % config.web.hostname])
19 temp_dir = tempfile.mkdtemp()
21 jarfile = os.path.join(temp_dir, 'VncViewer.jar')
23 shutil.copy('/usr/share/invirt-vnc-client/VncViewer.src.jar',
26 keystore = os.path.join(temp_dir, 'trust.store')
27 for host in config.hosts:
28 cert = Popen(['remctl', config.remote.hostname, 'web', 'vnccert', host.hostname],
31 check_call(['keytool', '-import', '-noprompt', '-alias', host.hostname,
32 '-keystore', keystore, '-storepass', 'foobar'],
35 check_call(['jar', 'uf', jarfile,
36 '-C', temp_dir, 'trust.store'])
38 shutil.move(jarfile, '/usr/share/invirt-vnc-client/VncViewer.jar')
40 shutil.rmtree(temp_dir)
42 if __name__ == '__main__':