Changeset 2261 for trunk/packages/invirt-vnc-client/debian
- Timestamp:
- Mar 18, 2009, 6:52:03 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/invirt-vnc-client/debian/invirt-update-vnc-cert
r1588 r2261 2 2 3 3 from invirt.config import structs as config 4 from subprocess import Popen, c all, PIPE4 from subprocess import Popen, check_call, PIPE, CalledProcessError 5 5 import tempfile 6 6 import os … … 8 8 import shutil 9 9 10 def check_wait(popen): 11 retcode = popen.wait() 12 if retcode != 0: 13 raise CalledProcessError(retcode, popen.pid) 14 return retcode 15 10 16 def main(): 11 call(['kinit', '-k', 'daemon/%s' % config.web.hostname]) 12 13 shutil.copy('/usr/share/invirt-vnc-client/VncViewer.src.jar', 14 '/usr/share/invirt-vnc-client/VncViewer.jar') 17 check_call(['kinit', '-k', 'daemon/%s' % config.web.hostname]) 15 18 16 19 temp_dir = tempfile.mkdtemp() 20 21 jarfile = os.path.join(temp_dir, 'VncViewer.jar') 22 23 shutil.copy('/usr/share/invirt-vnc-client/VncViewer.src.jar', 24 jarfile) 25 17 26 keystore = os.path.join(temp_dir, 'trust.store') 18 27 for host in config.hosts: 19 28 cert = Popen(['remctl', config.remote.hostname, 'web', 'vnccert', host.hostname], 20 29 stdout=PIPE) 21 c ert.wait()22 c all(['keytool', '-import', '-noprompt', '-alias', host.hostname,23 '-keystore', keystore, '-storepass', 'foobar'],24 stdin=cert.stdout)30 check_wait(cert) 31 check_call(['keytool', '-import', '-noprompt', '-alias', host.hostname, 32 '-keystore', keystore, '-storepass', 'foobar'], 33 stdin=cert.stdout) 25 34 26 call(['jar', 'uf', '/usr/share/invirt-vnc-client/VncViewer.jar', 27 '-C', temp_dir, 'trust.store']) 35 check_call(['jar', 'uf', jarfile, 36 '-C', temp_dir, 'trust.store']) 37 38 shutil.move(jarfile, '/usr/share/invirt-vnc-client/VncViewer.jar') 28 39 29 40 shutil.rmtree(temp_dir)
Note: See TracChangeset
for help on using the changeset viewer.