/breezy/unstable

To get this branch, use:
bzr branch https://code.breezy-vcs.org/breezy/unstable

« back to all changes in this revision

Viewing changes to breezy/transport/ftp/_gssapi.py

  • Committer: Jelmer Vernooij
  • Date: 2017-05-24 01:39:33 UTC
  • mfrom: (3815.3776.6)
  • Revision ID: jelmer@jelmer.uk-20170524013933-ir4y4tqtrsiz2ka2
New upstream snapshot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
 
24
24
import base64, ftplib
25
25
 
26
 
from bzrlib import (
 
26
from ... import (
27
27
    errors,
28
28
    )
29
 
from bzrlib.i18n import gettext
30
 
from bzrlib.trace import (
 
29
from ...i18n import gettext
 
30
from ...trace import (
31
31
    mutter,
32
32
    note,
33
33
    )
34
 
from bzrlib.transport.ftp import FtpTransport
 
34
from ..ftp import FtpTransport
35
35
 
36
36
try:
37
37
    import kerberos
38
 
except ImportError, e:
 
38
except ImportError as e:
39
39
    mutter('failed to import kerberos lib: %s', e)
40
40
    raise errors.DependencyNotPresent('kerberos', e)
41
41
 
84
84
                        rc = kerberos.authGSSClientStep(self.vc, resp[9:])
85
85
                        if not ((resp.startswith('235 ') and rc == 1) or
86
86
                                (resp.startswith('335 ') and rc == 0)):
87
 
                            raise ftplib.error_reply, resp
 
87
                            raise ftplib.error_reply(resp)
88
88
            note(gettext("Authenticated as %s") %
89
89
                 kerberos.authGSSClientUserName(self.vc))
90
90
 
114
114
        """
115
115
        try:
116
116
            connection.gssapi_login(user=user)
117
 
        except ftplib.error_perm, e:
 
117
        except ftplib.error_perm as e:
118
118
            super(GSSAPIFtpTransport, self)._login(connection, auth,
119
119
                                                   user, password)
120
120
 
121
121
 
122
122
def get_test_permutations():
123
123
    """Return the permutations to be used in testing."""
124
 
    from bzrlib.tests import ftp_server
 
124
    from ...tests import ftp_server
125
125
    if ftp_server.FTPServerFeature.available():
126
126
        return [(GSSAPIFtpTransport, ftp_server.FTPTestServer)]
127
127
    else: