def requestAvatarId(self, c): creds = credentials.IUsernamePassword(c, None) if creds is not None: conn = SwiftConnection(self.auth_url, creds.username, creds.password, pool=self.pool, verbose=self.verbose) conn.user_agent = USER_AGENT d = conn.authenticate() d.addCallback(self._after_auth, conn) d.addErrback(failed_auth) return d return defer.fail(error.UnauthorizedLogin())