Пример #1
0
        key_args = {
            'name_real': name_real,
            'name_email': name_email,
            'name_comment': name_comment,
            'passphrase': passphrase,
            'key_type': 'RSA',
            'key_length': 2048,
            'subkey_type': 'RSA',
            'subkey_length': 2048,
            'expire_date': 0,
        }
        print 'Creating node key, type on the keyboard, move the mouse, utilize the disks to generate entropy.'
        try:
            key = gpg.create_key(**key_args)
            node.uuid = key.fingerprint
            node.name = name_real
            node.email = name_email
            node.comment = name_comment
            node.save()
            network = NetworkCall()
            network.publish_key(key)
        except Exception, msg:
            print 'Unhandled exception: %s' % msg
    else:
        print 'Existing identity not modified.'


register_interval_job('heartbeat_check', heartbeat_check, seconds=HEARTBEAT_QUERY_INTERVAL)
register_interval_job('inventory_hash_check', inventory_hash_check, seconds=INVENTORY_QUERY_INTERVAL)

Пример #2
0
from django_gpg.api import GPG, Key
from django_gpg.exceptions import GPGVerificationError, \
    GPGDecryptionError, GPGSigningError, KeyDeleteError, \
    KeyGenerationError, KeyFetchingError, KeyDoesNotExist
from django_gpg.tasks import background_key_generator, BACKGROUND_KEY_GENERATOR_INTERVAL

from scheduler import register_interval_job

register_interval_job('background_key_generator', background_key_generator, seconds=BACKGROUND_KEY_GENERATOR_INTERVAL)