+ jarfile = os.path.join(temp_dir, 'VncViewer.jar')
+
+ shutil.copy('/usr/share/invirt-vnc-client/VncViewer.src.jar',
+ jarfile)
+
+ keystore = os.path.join(temp_dir, 'trust.store')
+ for host in config.hosts:
+ cert = Popen(['remctl', config.remote.hostname, 'web', 'vnccert', host.hostname],
+ stdout=PIPE)
+ check_wait(cert)
+ check_call(['keytool', '-import', '-noprompt', '-alias', host.hostname,
+ '-keystore', keystore, '-storepass', 'foobar'],
+ stdin=cert.stdout)
+
+ check_call(['jar', 'uf', jarfile,
+ '-C', temp_dir, 'trust.store'])
+
+ shutil.move(jarfile, '/usr/share/invirt-vnc-client/VncViewer.jar')
+
+ shutil.rmtree(temp_dir)
+
+if __name__ == '__main__':
+ sys.exit(main())