~ci-train-bot/ubuntu-system-image/system-image-ubuntu-xenial-landing-023

« back to all changes in this revision

Viewing changes to systemimage/gpg.py

  • Committer: Barry Warsaw
  • Date: 2015-05-08 21:41:15 UTC
  • mfrom: (0.3.2)
  • mto: (240.2.1 system-image)
  • mto: This revision was merged to the branch mainline in revision 241.
  • Revision ID: barry@python.org-20150508214115-7x9811br9w04x9ae
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2013-2014 Canonical Ltd.
 
1
# Copyright (C) 2013-2015 Canonical Ltd.
2
2
# Author: Barry Warsaw <barry@ubuntu.com>
3
3
 
4
4
# This program is free software: you can redistribute it and/or modify
188
188
        :type data_path: str
189
189
        :return: bool
190
190
        """
 
191
        # For testing on some systems that are connecting to test servers, GPG
 
192
        # verification isn't possible.  The s-i-cli supports a switch to
 
193
        # disable all GPG checks.
 
194
        if config.skip_gpg_verification:
 
195
            return True
191
196
        with open(signature_path, 'rb') as sig_fp:
192
197
            verified = self._ctx.verify_file(sig_fp, data_path)
193
198
        # If the file is properly signed, we'll be able to get back a set of