Standardize what we mean by server

This commit is contained in:
Ian Gulliver
2016-05-18 00:15:25 +00:00
parent 043bfd4338
commit fc7a670a1f
2 changed files with 3 additions and 11 deletions

View File

@@ -4,7 +4,6 @@ import argparse
import os import os
import shutil import shutil
import subprocess import subprocess
from urllib import parse
parser = argparse.ArgumentParser(description='iconograph autoimage') parser = argparse.ArgumentParser(description='iconograph autoimage')
@@ -120,7 +119,7 @@ start on runlevel [2345]
script script
exec </dev/tty8 >/dev/tty8 2>&1 exec </dev/tty8 >/dev/tty8 2>&1
chvt 8 chvt 8
/icon/iconograph/client/wait_for_service.py --host=%(host)s --service=%(service)s /icon/iconograph/client/wait_for_service.py --host=%(server)s --service=https
chvt 8 chvt 8
/icon/iconograph/client/image.py --device=%(device)s --persistent-percent=%(persistent_percent)d --ca-cert=/icon/config/ca.image.cert.pem --server=%(server)s --image-type=%(image_type)s %(image_flags)s /icon/iconograph/client/image.py --device=%(device)s --persistent-percent=%(persistent_percent)d --ca-cert=/icon/config/ca.image.cert.pem --server=%(server)s --image-type=%(image_type)s %(image_flags)s
chvt 8 chvt 8
@@ -133,8 +132,6 @@ script
/icon/iconograph/client/alert.py --type=happy /icon/iconograph/client/alert.py --type=happy
end script end script
""" % { """ % {
'host': FLAGS.server,
'service': 'https',
'device': FLAGS.device, 'device': FLAGS.device,
'persistent_percent': FLAGS.persistent_percent, 'persistent_percent': FLAGS.persistent_percent,
'server': FLAGS.server, 'server': FLAGS.server,

View File

@@ -4,7 +4,6 @@ import argparse
import os import os
import shutil import shutil
import subprocess import subprocess
from urllib import parse
parser = argparse.ArgumentParser(description='iconograph autoimage') parser = argparse.ArgumentParser(description='iconograph autoimage')
@@ -93,8 +92,6 @@ def main():
os.path.join(FLAGS.chroot_path, client_key_path)) os.path.join(FLAGS.chroot_path, client_key_path))
os.chmod(os.path.join(FLAGS.chroot_path, client_key_path), 0o400) os.chmod(os.path.join(FLAGS.chroot_path, client_key_path), 0o400)
parsed = parse.urlparse(FLAGS.server)
init = os.path.join(FLAGS.chroot_path, 'etc', 'init', 'certclient.%s.conf' % FLAGS.tag) init = os.path.join(FLAGS.chroot_path, 'etc', 'init', 'certclient.%s.conf' % FLAGS.tag)
with open(init, 'w') as fh: with open(init, 'w') as fh:
fh.write(""" fh.write("""
@@ -116,7 +113,7 @@ script
fi fi
chvt 9 chvt 9
/icon/iconograph/client/wait_for_service.py --host=%(host)s --service=%(service)s /icon/iconograph/client/wait_for_service.py --host=%(server)s --service=https
chvt 9 chvt 9
if test ! -s "${CERT}"; then if test ! -s "${CERT}"; then
@@ -132,11 +129,9 @@ script
echo "==================" echo "=================="
end script end script
""" % { """ % {
'host': parsed.hostname, 'server': FLAGS.server,
'service': parsed.port or parsed.scheme,
'subject': FLAGS.subject, 'subject': FLAGS.subject,
'tag': FLAGS.tag, 'tag': FLAGS.tag,
'server': FLAGS.server,
}) })