From fc7a670a1f0efa0d3f21d23760859afaa77f29da Mon Sep 17 00:00:00 2001 From: Ian Gulliver Date: Wed, 18 May 2016 00:15:25 +0000 Subject: [PATCH] Standardize what we mean by server --- server/modules/autoimage.py | 5 +---- server/modules/certclient.py | 9 ++------- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/server/modules/autoimage.py b/server/modules/autoimage.py index cb3896c..2b7ad81 100755 --- a/server/modules/autoimage.py +++ b/server/modules/autoimage.py @@ -4,7 +4,6 @@ import argparse import os import shutil import subprocess -from urllib import parse parser = argparse.ArgumentParser(description='iconograph autoimage') @@ -120,7 +119,7 @@ start on runlevel [2345] script exec /dev/tty8 2>&1 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 /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 @@ -133,8 +132,6 @@ script /icon/iconograph/client/alert.py --type=happy end script """ % { - 'host': FLAGS.server, - 'service': 'https', 'device': FLAGS.device, 'persistent_percent': FLAGS.persistent_percent, 'server': FLAGS.server, diff --git a/server/modules/certclient.py b/server/modules/certclient.py index 7d8b4f1..847414c 100755 --- a/server/modules/certclient.py +++ b/server/modules/certclient.py @@ -4,7 +4,6 @@ import argparse import os import shutil import subprocess -from urllib import parse parser = argparse.ArgumentParser(description='iconograph autoimage') @@ -93,8 +92,6 @@ def main(): os.path.join(FLAGS.chroot_path, client_key_path)) 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) with open(init, 'w') as fh: fh.write(""" @@ -116,7 +113,7 @@ script fi 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 if test ! -s "${CERT}"; then @@ -132,11 +129,9 @@ script echo "==================" end script """ % { - 'host': parsed.hostname, - 'service': parsed.port or parsed.scheme, + 'server': FLAGS.server, 'subject': FLAGS.subject, 'tag': FLAGS.tag, - 'server': FLAGS.server, })