~styluseater/swift/lp610583

« back to all changes in this revision

Viewing changes to swift/common/client.py

  • Committer: Tarmac
  • Author(s): Monty Taylor
  • Date: 2010-07-26 15:27:29 UTC
  • mfrom: (40.1.1 fix-pep8)
  • Revision ID: hudson@openstack.org-20100726152729-4dz6gc11ky2qvffi
Fixed PEP8 warnings

Show diffs side-by-side

added added

removed removed

Lines of Context:
150
150
    :param url: authentication URL
151
151
    :param user: user to auth as
152
152
    :param key: key or passowrd for auth
153
 
    :param snet: use SERVICENET internal network default is False 
 
153
    :param snet: use SERVICENET internal network default is False
154
154
    :returns: tuple of (storage URL, storage token, auth token)
155
155
    :raises ClientException: HTTP GET request to auth URL failed
156
156
    """
166
166
    url = resp.getheader('x-storage-url')
167
167
    if snet:
168
168
        parsed = list(urlparse(url))
169
 
        # Second item in the list is the netloc 
 
169
        # Second item in the list is the netloc
170
170
        parsed[1] = 'snet-' + parsed[1]
171
171
        url = urlunparse(parsed)
172
172
    return url, resp.getheader('x-storage-token',
611
611
        :param preauthurl: storage URL (if you have already authenticated)
612
612
        :param preauthtoken: authentication token (if you have already
613
613
                             authenticated)
614
 
        :param snet: use SERVICENET internal network default is False 
 
614
        :param snet: use SERVICENET internal network default is False
615
615
        """
616
616
        self.authurl = authurl
617
617
        self.user = user
632
632
            try:
633
633
                if not self.url or not self.token:
634
634
                    self.url, self.token = \
635
 
                        get_auth(self.authurl, self.user, self.key, snet=self.snet)
 
635
                        get_auth(self.authurl, self.user, self.key,
 
636
                                 snet=self.snet)
636
637
                    self.http_conn = None
637
638
                if not self.http_conn:
638
639
                    self.http_conn = http_connection(self.url)