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 if config.vnc.has_key("signing_keystore_path") \
39 and os.path.exists(config.vnc.signing_keystore_path):
40 check_call(['jarsigner', '-keystore',
41 config.vnc.signing_keystore_path,
42 '-storepass', 'changeit', jarfile,
43 config.vnc.signing_key_alias])
45 shutil.move(jarfile, '/usr/share/invirt-vnc-client/VncViewer.jar')
47 shutil.rmtree(temp_dir)
49 if __name__ == '__main__':