Support certs in fetcher

This commit is contained in:
Ian Gulliver
2016-04-06 22:52:48 -07:00
parent 1e1fff2e1c
commit 14f2be7e10
2 changed files with 22 additions and 1 deletions

View File

@@ -22,6 +22,10 @@ parser.add_argument(
dest='chroot_path',
action='store',
required=True)
parser.add_argument(
'--https-ca-cert',
dest='https_ca_cert',
action='store')
parser.add_argument(
'--max-images',
dest='max_images',
@@ -60,6 +64,12 @@ def main():
FLAGS.ca_cert,
os.path.join(FLAGS.chroot_path, 'icon', 'config', 'ca.image.cert.pem'))
if FLAGS.https_ca_cert:
shutil.copyfile(
FLAGS.https_ca_cert,
os.path.join(FLAGS.chroot_path, 'icon', 'config', 'ca.www.cert.pem'))
path = os.path.join(FLAGS.chroot_path, 'icon', 'config', 'fetcher.flags')
with open(path, 'w') as fh:
fh.write('--base-url=%(base_url)s --max-images=%(max_images)d\n' % {