Merge "Rip out SERVICENET support"
This commit is contained in:
@@ -177,7 +177,6 @@ For examples see swift auth \-\-help.
|
||||
.PD 0
|
||||
.IP "--version Show program's version number and exit"
|
||||
.IP "-h, --help Show this (or any subcommand if after command) help message and exit"
|
||||
.IP "-s, --snet Use SERVICENET internal network"
|
||||
.IP "-v, --verbose Print more info"
|
||||
.IP "-q, --quiet Suppress status output"
|
||||
.IP "-A AUTH, --auth=AUTH URL for obtaining an auth token "
|
||||
|
||||
@@ -20,7 +20,7 @@ swift usage
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
Usage: swift [--version] [--help] [--os-help] [--snet] [--verbose]
|
||||
Usage: swift [--version] [--help] [--os-help] [--verbose]
|
||||
[--debug] [--info] [--quiet] [--auth <auth_url>]
|
||||
[--auth-version <auth_version> |
|
||||
--os-identity-api-version <auth_version> ]
|
||||
@@ -95,9 +95,6 @@ swift optional arguments
|
||||
``--os-help``
|
||||
Show OpenStack authentication options.
|
||||
|
||||
``-s, --snet``
|
||||
Use SERVICENET internal network.
|
||||
|
||||
``-v, --verbose``
|
||||
Print more info.
|
||||
|
||||
|
||||
@@ -490,7 +490,7 @@ def http_connection(*arg, **kwarg):
|
||||
return conn.parsed_url, conn
|
||||
|
||||
|
||||
def get_auth_1_0(url, user, key, snet, **kwargs):
|
||||
def get_auth_1_0(url, user, key, **kwargs):
|
||||
cacert = kwargs.get('cacert', None)
|
||||
insecure = kwargs.get('insecure', False)
|
||||
cert = kwargs.get('cert')
|
||||
@@ -514,12 +514,6 @@ def get_auth_1_0(url, user, key, snet, **kwargs):
|
||||
# if we don't have a x-storage-url header and if we get a body.
|
||||
if resp.status < 200 or resp.status >= 300 or (body and not url):
|
||||
raise ClientException.from_response(resp, 'Auth GET failed', body)
|
||||
if snet:
|
||||
parsed = list(urlparse(url))
|
||||
# Second item in the list is the netloc
|
||||
netloc = parsed[1]
|
||||
parsed[1] = 'snet-' + netloc
|
||||
url = urlunparse(parsed)
|
||||
|
||||
token = resp.getheader('x-storage-token', resp.getheader('x-auth-token'))
|
||||
return url, token
|
||||
@@ -671,12 +665,6 @@ def get_auth(auth_url, user, key, **kwargs):
|
||||
N.B. if the optional os_options parameter includes a non-empty
|
||||
'object_storage_url' key it will override the default storage url returned
|
||||
by the auth service.
|
||||
|
||||
The snet parameter is used for Rackspace's ServiceNet internal network
|
||||
implementation. In this function, it simply adds *snet-* to the beginning
|
||||
of the host name for the returned storage URL. With Rackspace Cloud Files,
|
||||
use of this network path causes no bandwidth charges but requires the
|
||||
client to be running on Rackspace's ServiceNet network.
|
||||
"""
|
||||
session = kwargs.get('session', None)
|
||||
auth_version = kwargs.get('auth_version', '1')
|
||||
@@ -700,7 +688,6 @@ def get_auth(auth_url, user, key, **kwargs):
|
||||
storage_url, token = get_auth_1_0(auth_url,
|
||||
user,
|
||||
key,
|
||||
kwargs.get('snet'),
|
||||
cacert=cacert,
|
||||
insecure=insecure,
|
||||
cert=cert,
|
||||
@@ -1654,7 +1641,7 @@ class Connection:
|
||||
"""
|
||||
|
||||
def __init__(self, authurl=None, user=None, key=None, retries=5,
|
||||
preauthurl=None, preauthtoken=None, snet=False,
|
||||
preauthurl=None, preauthtoken=None,
|
||||
starting_backoff=1, max_backoff=64, tenant_name=None,
|
||||
os_options=None, auth_version="1", cacert=None,
|
||||
insecure=False, cert=None, cert_key=None,
|
||||
@@ -1669,7 +1656,6 @@ class Connection:
|
||||
:param preauthtoken: authentication token (if you have already
|
||||
authenticated) note authurl/user/key/tenant_name
|
||||
are not required when specifying preauthtoken
|
||||
:param snet: use SERVICENET internal network default is False
|
||||
:param starting_backoff: initial delay between retries (seconds)
|
||||
:param max_backoff: maximum delay between retries (seconds)
|
||||
:param auth_version: OpenStack auth version, default is 1.0
|
||||
@@ -1705,7 +1691,6 @@ class Connection:
|
||||
self.retries = retries
|
||||
self.http_conn = None
|
||||
self.attempts = 0
|
||||
self.snet = snet
|
||||
self.starting_backoff = starting_backoff
|
||||
self.max_backoff = max_backoff
|
||||
self.auth_version = auth_version
|
||||
@@ -1740,7 +1725,7 @@ class Connection:
|
||||
|
||||
def get_auth(self):
|
||||
self.url, self.token = get_auth(self.authurl, self.user, self.key,
|
||||
session=self.session, snet=self.snet,
|
||||
session=self.session,
|
||||
auth_version=self.auth_version,
|
||||
os_options=self.os_options,
|
||||
cacert=self.cacert,
|
||||
@@ -1761,7 +1746,6 @@ class Connection:
|
||||
service_key = opts.get('service_key', None)
|
||||
return get_auth(self.authurl, service_user, service_key,
|
||||
session=self.session,
|
||||
snet=self.snet,
|
||||
auth_version=self.auth_version,
|
||||
os_options=service_options,
|
||||
cacert=self.cacert,
|
||||
|
||||
@@ -163,7 +163,6 @@ def process_options(options):
|
||||
|
||||
def _build_default_global_options():
|
||||
return {
|
||||
"snet": False,
|
||||
"verbose": 1,
|
||||
"debug": False,
|
||||
"info": False,
|
||||
@@ -298,7 +297,6 @@ def get_conn(options):
|
||||
retries=options['retries'],
|
||||
auth_version=options['auth_version'],
|
||||
os_options=options['os_options'],
|
||||
snet=options['snet'],
|
||||
cacert=options['os_cacert'],
|
||||
insecure=options['insecure'],
|
||||
cert=options['os_cert'],
|
||||
|
||||
@@ -1727,8 +1727,6 @@ def add_default_args(parser):
|
||||
help='Show OpenStack authentication options.')
|
||||
parser.add_argument('--os_help', action='store_true',
|
||||
help=argparse.SUPPRESS)
|
||||
parser.add_argument('-s', '--snet', action='store_true', dest='snet',
|
||||
default=False, help='Use SERVICENET internal network.')
|
||||
parser.add_argument('-v', '--verbose', action='count', dest='verbose',
|
||||
default=1, help='Print more info.')
|
||||
parser.add_argument('--debug', action='store_true', dest='debug',
|
||||
@@ -1965,7 +1963,7 @@ def main(arguments=None):
|
||||
|
||||
parser = argparse.ArgumentParser(
|
||||
add_help=False, formatter_class=HelpFormatter, usage='''
|
||||
%(prog)s [--version] [--help] [--os-help] [--snet] [--verbose]
|
||||
%(prog)s [--version] [--help] [--os-help] [--verbose]
|
||||
[--debug] [--debug-with-secrets] [--info] [--quiet]
|
||||
[--auth <auth_url>] [--auth-version <auth_version> |
|
||||
--os-identity-api-version <auth_version> ]
|
||||
|
||||
Reference in New Issue
Block a user