Пример #1
0
    def _getKeyGenerator(self, archive_reference=None, txn=None):
        """Return a `PPAKeyGenerator` instance.

        Monkey-patch the script object with a fake transaction manager
        and also make it use an alternative (fake and lighter) procedure
        to generate keys for each PPA.
        """
        test_args = []

        if archive_reference is not None:
            test_args.extend(['-A', archive_reference])

        key_generator = PPAKeyGenerator(
            name='ppa-generate-keys', test_args=test_args)

        if txn is None:
            txn = FakeTransaction()
        key_generator.txn = txn

        def fake_key_generation(archive):
            a_key = getUtility(IGPGKeySet).getByFingerprint(
                'ABCDEF0123456789ABCDDCBA0000111112345678')
            archive.signing_key_fingerprint = a_key.fingerprint
            archive.signing_key_owner = a_key.owner
            del get_property_cache(archive).signing_key

        key_generator.generateKey = fake_key_generation

        return key_generator
    def _getKeyGenerator(self, ppa_owner_name=None, txn=None):
        """Return a `PPAKeyGenerator` instance.

        Monkey-patch the script object with a fake transaction manager
        and also make it use an alternative (fake and lighter) procedure
        to generate keys for each PPA.
        """
        test_args = []

        if ppa_owner_name is not None:
            test_args.extend(['-p', ppa_owner_name])

        key_generator = PPAKeyGenerator(
            name='ppa-generate-keys', test_args=test_args)

        if txn is None:
            txn = FakeTransaction()
        key_generator.txn = txn

        def fake_key_generation(archive):
            a_key = getUtility(IGPGKeySet).get(1)
            archive.signing_key = a_key

        key_generator.generateKey = fake_key_generation

        return key_generator
    def _getKeyGenerator(self, ppa_owner_name=None, txn=None):
        """Return a `PPAKeyGenerator` instance.

        Monkey-patch the script object with a fake transaction manager
        and also make it use an alternative (fake and lighter) procedure
        to generate keys for each PPA.
        """
        test_args = []

        if ppa_owner_name is not None:
            test_args.extend(['-p', ppa_owner_name])

        key_generator = PPAKeyGenerator(name='ppa-generate-keys',
                                        test_args=test_args)

        if txn is None:
            txn = FakeTransaction()
        key_generator.txn = txn

        def fake_key_generation(archive):
            a_key = getUtility(IGPGKeySet).get(1)
            archive.signing_key = a_key

        key_generator.generateKey = fake_key_generation

        return key_generator
Пример #4
0
#!/usr/bin/python -S
#
# Copyright 2009 Canonical Ltd.  This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).

"""A cron script that generate missing PPA signing keys."""

__metaclass__ = type

import _pythonpath

from lp.services.config import config
from lp.soyuz.scripts.ppakeygenerator import PPAKeyGenerator


if __name__ == "__main__":
    script = PPAKeyGenerator("ppa-generate-keys", config.archivepublisher.dbuser)
    script.lock_and_run()
#!/usr/bin/python -S
#
# Copyright 2009 Canonical Ltd.  This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).

"""A cron script that generate missing PPA signing keys."""

__metaclass__ = type

import _pythonpath

from lp.services.config import config
from lp.soyuz.scripts.ppakeygenerator import PPAKeyGenerator


if __name__ == '__main__':
    script = PPAKeyGenerator(
        "ppa-generate-keys", config.archivepublisher.dbuser)
    script.lock_and_run()