~nataliabidart/ubuntu-sso-client/displayname-stable

« back to all changes in this revision

Viewing changes to ubuntu_sso/main.py

  • Committer: Tarmac
  • Author(s): natalia.bidart at canonical
  • Date: 2010-10-18 21:16:46 UTC
  • mfrom: (634.1.1 handle-ping-error)
  • Revision ID: tarmac-20101018211646-82syq2lupae2qdge
* Credentials are removed if the pinging to the server fails or any other exception occurs (LP: #660516).

Show diffs side-by-side

added added

removed removed

Lines of Context:
510
510
 
511
511
    def _login_success_cb(self, dialog, app_name, email):
512
512
        """Handles the response from the UI dialog."""
513
 
        logger.info('Login successful for app %r, email %r', app_name, email)
 
513
        logger.info('Login successful for app %r, email %r. Still pending to '
 
514
                    'ping server and send result signal.', app_name, email)
514
515
        try:
515
516
            creds = keyring_get_credentials(app_name)
516
517
            self._ping_url(app_name, email, creds)
518
519
        except:  # pylint: disable=W0702
519
520
            msg = "Problem getting the credentials from the keyring."
520
521
            logger.exception(msg)
 
522
            self.clear_token(app_name)
521
523
            self.CredentialsError(app_name, msg, traceback.format_exc())
522
524
 
523
525
    def _login_error_cb(self, dialog, app_name, error):
639
641
 
640
642
        'app_name' is the name of the application.
641
643
        """
 
644
        logger.info('Clearing credentials for app %r.', app_name)
642
645
        try:
643
646
            creds = Keyring(app_name)
644
647
            creds.delete_ubuntusso_attr()