(self)
Setup for a receiver that is already registered

        If already registered, confirm that the registered GPG key is available
        in the keyring and prompt for the GPG private key passphrase required
        to sign report data
Setup for a receiver that is already registered
Setup for a receiver that is already registered
def _setup_registered(self):
        """Setup for a receiver that is already registered

        If already registered, confirm that the registered GPG key is available
        in the keyring and prompt for the GPG private key passphrase required
        to sign report data

        """
        fingerprint = self.user_info['monitoring']['fingerprint']
        matching_keys = self.gpg.gpg.list_keys(True, keys=fingerprint)
        if (len(matching_keys) == 0):
            logger.error("Could not find key {} in the local "
                         "keyring.".format(fingerprint))
            try_again = util.ask_yes_or_no(
                "Reset the Monitoring API credentials and try registering "
                "with a new key?",
                default="n")
            if (try_again):
                self._delete_credentials()
                self._register()
            else:
                raise RuntimeError("Monitoring configuration failed")

            # Return regardless. If the key is not available, don't bother
            # about the password.
            return
        self.gpg.prompt_passphrase('Please enter your GPG passphrase to '
                                   'sign receiver reports: ')
def _setup_registered ( self ) : fingerprint = self . user_info [ 'monitoring' ] [ 'fingerprint' ] matching_keys = self . gpg . gpg . list_keys ( True , keys = fingerprint ) if ( len ( matching_keys ) == 0 ) : logger . error ( "Could not find key {} in the local " "keyring." . format ( fingerprint ) ) try_again = util . ask_yes_or_no ( "Reset the Monitoring API credentials and try registering " "with a new key?" , default = "n" ) if ( try_again ) : self . _delete_credentials ( ) self . _register ( ) else : raise RuntimeError ( "Monitoring configuration failed" ) # Return regardless. If the key is not available, don't bother # about the password. return self . gpg . prompt_passphrase ( 'Please enter your GPG passphrase to ' 'sign receiver reports: ' )