コード例 #1
0
ファイル: utils.py プロジェクト: powersj/netplan-test
    def policy(content, path=None):  # pylint: disable=unused-argument
        """Simplestreams policy function.

        @param content: signed content
        @param path: not used
        @return: policy for simplestreams
        """
        return s_util.read_signed(content, keyring=keyring)
コード例 #2
0
def policy(content, path):
    if path.endswith('sjson'):
        return read_signed(content, keyring=KEYRING)
    else:
        return content
コード例 #3
0
 def policy(content, path):
     return s_util.read_signed(content, keyring=img_conf['keyring'])
コード例 #4
0
 def test_read_signed(self):
     path = os.path.join(EXAMPLES_DIR, 'foocloud/streams/v1/index.sjson')
     with open(path) as fileobj:
         util.read_signed(fileobj.read())
コード例 #5
0
 def test_no_check(self):
     streams = os.path.join(EXAMPLES_DIR, 'foocloud/streams/v1')
     path = os.path.join(streams, 'index.sjson')
     with open(path) as fileobj:
         util.read_signed(fileobj.read(), checked=False)
コード例 #6
0
 def policy(content, path):  # pylint: disable=W0613
     """Read signed content with the defined keyring."""
     return s_util.read_signed(content, keyring=self.keyring_path)
コード例 #7
0
 def policy(content, path):  # pylint: disable=W0613
     """TODO."""
     return s_util.read_signed(content, keyring=self.keyring_path)
コード例 #8
0
ファイル: platform.py プロジェクト: cloud-init/cloud-init
 def policy(content, path):
     return s_util.read_signed(content, keyring=img_conf['keyring'])
コード例 #9
0
ファイル: ephemerals_script.py プロジェクト: cloudbase/maas
 def verify_signature(content, path):
     """Policy callback for Simplestreams: verify index signature."""
     return util.read_signed(content, keyring=args.keyring)
コード例 #10
0
ファイル: image_sync.py プロジェクト: lucasmoura/curtin
 def policy(content, path):  # pylint: disable=W0613
     if initial_path.endswith('sjson'):
         return sutil.read_signed(content, keyring=keyring)
     else:
         return content