Remove unnecessary object subclassing
All classes subclass from object by default in Python 3. Signed-off-by: Stephen Finucane <stephenfin@redhat.com> Change-Id: I5a1ad57bcc092861ce969759b06a07c880ad3d35
This commit is contained in:
parent
fa137a5bf1
commit
61ce5ac824
@ -68,7 +68,7 @@ UTC = _UTC()
|
|||||||
del _UTC
|
del _UTC
|
||||||
|
|
||||||
|
|
||||||
class ServiceCatalogV1(object):
|
class ServiceCatalogV1:
|
||||||
def __init__(self, auth_url, storage_url, account):
|
def __init__(self, auth_url, storage_url, account):
|
||||||
self.auth_url = auth_url
|
self.auth_url = auth_url
|
||||||
self._storage_url = storage_url
|
self._storage_url = storage_url
|
||||||
@ -148,7 +148,7 @@ class ServiceCatalogV1(object):
|
|||||||
raise exceptions.EndpointNotFound(msg)
|
raise exceptions.EndpointNotFound(msg)
|
||||||
|
|
||||||
|
|
||||||
class AccessInfoV1(object):
|
class AccessInfoV1:
|
||||||
"""An object for encapsulating a raw v1 auth token."""
|
"""An object for encapsulating a raw v1 auth token."""
|
||||||
|
|
||||||
def __init__(self, auth_url, storage_url, account, username, auth_token,
|
def __init__(self, auth_url, storage_url, account, username, auth_token,
|
||||||
|
@ -217,7 +217,7 @@ def encode_meta_headers(headers):
|
|||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
|
||||||
class _ObjectBody(object):
|
class _ObjectBody:
|
||||||
"""
|
"""
|
||||||
Readable and iterable object body response wrapper.
|
Readable and iterable object body response wrapper.
|
||||||
"""
|
"""
|
||||||
@ -331,7 +331,7 @@ class _RetryBody(_ObjectBody):
|
|||||||
return buf
|
return buf
|
||||||
|
|
||||||
|
|
||||||
class HTTPConnection(object):
|
class HTTPConnection:
|
||||||
def __init__(self, url, proxy=None, cacert=None, insecure=False,
|
def __init__(self, url, proxy=None, cacert=None, insecure=False,
|
||||||
cert=None, cert_key=None, ssl_compression=False,
|
cert=None, cert_key=None, ssl_compression=False,
|
||||||
default_user_agent=None, timeout=None):
|
default_user_agent=None, timeout=None):
|
||||||
@ -1634,7 +1634,7 @@ def get_capabilities(http_conn):
|
|||||||
return parse_api_response(resp_headers, body)
|
return parse_api_response(resp_headers, body)
|
||||||
|
|
||||||
|
|
||||||
class Connection(object):
|
class Connection:
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Convenience class to make requests that will also retry the request
|
Convenience class to make requests that will also retry the request
|
||||||
|
@ -19,7 +19,7 @@ from concurrent.futures import ThreadPoolExecutor
|
|||||||
from queue import PriorityQueue
|
from queue import PriorityQueue
|
||||||
|
|
||||||
|
|
||||||
class OutputManager(object):
|
class OutputManager:
|
||||||
"""
|
"""
|
||||||
One object to manage and provide helper functions for output.
|
One object to manage and provide helper functions for output.
|
||||||
|
|
||||||
@ -108,7 +108,7 @@ class OutputManager(object):
|
|||||||
self.error_print_pool.submit(self._print_error, msg, count=0)
|
self.error_print_pool.submit(self._print_error, msg, count=0)
|
||||||
|
|
||||||
|
|
||||||
class MultiThreadingManager(object):
|
class MultiThreadingManager:
|
||||||
"""
|
"""
|
||||||
One object to manage context for multi-threading. This should make
|
One object to manage context for multi-threading. This should make
|
||||||
bin/swift less error-prone and allow us to test this code.
|
bin/swift less error-prone and allow us to test this code.
|
||||||
|
@ -315,7 +315,7 @@ def split_headers(options, prefix=''):
|
|||||||
return headers
|
return headers
|
||||||
|
|
||||||
|
|
||||||
class SwiftUploadObject(object):
|
class SwiftUploadObject:
|
||||||
"""
|
"""
|
||||||
Class for specifying an object upload, allowing the object source, name and
|
Class for specifying an object upload, allowing the object source, name and
|
||||||
options to be specified separately for each individual object.
|
options to be specified separately for each individual object.
|
||||||
@ -341,7 +341,7 @@ class SwiftUploadObject(object):
|
|||||||
self.source = source
|
self.source = source
|
||||||
|
|
||||||
|
|
||||||
class SwiftPostObject(object):
|
class SwiftPostObject:
|
||||||
"""
|
"""
|
||||||
Class for specifying an object post, allowing the headers/metadata to be
|
Class for specifying an object post, allowing the headers/metadata to be
|
||||||
specified separately for each individual object.
|
specified separately for each individual object.
|
||||||
@ -355,7 +355,7 @@ class SwiftPostObject(object):
|
|||||||
self.options = options
|
self.options = options
|
||||||
|
|
||||||
|
|
||||||
class SwiftDeleteObject(object):
|
class SwiftDeleteObject:
|
||||||
"""
|
"""
|
||||||
Class for specifying an object delete, allowing the headers/metadata to be
|
Class for specifying an object delete, allowing the headers/metadata to be
|
||||||
specified separately for each individual object.
|
specified separately for each individual object.
|
||||||
@ -369,7 +369,7 @@ class SwiftDeleteObject(object):
|
|||||||
self.options = options
|
self.options = options
|
||||||
|
|
||||||
|
|
||||||
class SwiftCopyObject(object):
|
class SwiftCopyObject:
|
||||||
"""
|
"""
|
||||||
Class for specifying an object copy,
|
Class for specifying an object copy,
|
||||||
allowing the destination/headers/metadata/fresh_metadata to be specified
|
allowing the destination/headers/metadata/fresh_metadata to be specified
|
||||||
@ -405,7 +405,7 @@ class SwiftCopyObject(object):
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class _SwiftReader(object):
|
class _SwiftReader:
|
||||||
"""
|
"""
|
||||||
Class for downloading objects from swift and raising appropriate
|
Class for downloading objects from swift and raising appropriate
|
||||||
errors on failures caused by either invalid md5sum or size of the
|
errors on failures caused by either invalid md5sum or size of the
|
||||||
@ -470,7 +470,7 @@ class _SwiftReader(object):
|
|||||||
return self._actual_read
|
return self._actual_read
|
||||||
|
|
||||||
|
|
||||||
class SwiftService(object):
|
class SwiftService:
|
||||||
"""
|
"""
|
||||||
Service for performing swift operations
|
Service for performing swift operations
|
||||||
"""
|
"""
|
||||||
|
@ -254,7 +254,7 @@ def report_traceback():
|
|||||||
return None, None
|
return None, None
|
||||||
|
|
||||||
|
|
||||||
class NoopMD5(object):
|
class NoopMD5:
|
||||||
def __init__(self, *a, **kw):
|
def __init__(self, *a, **kw):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@ -265,7 +265,7 @@ class NoopMD5(object):
|
|||||||
return ''
|
return ''
|
||||||
|
|
||||||
|
|
||||||
class ReadableToIterable(object):
|
class ReadableToIterable:
|
||||||
"""
|
"""
|
||||||
Wrap a filelike object and act as an iterator.
|
Wrap a filelike object and act as an iterator.
|
||||||
|
|
||||||
@ -314,7 +314,7 @@ class ReadableToIterable(object):
|
|||||||
return self
|
return self
|
||||||
|
|
||||||
|
|
||||||
class LengthWrapper(object):
|
class LengthWrapper:
|
||||||
"""
|
"""
|
||||||
Wrap a filelike object with a maximum length.
|
Wrap a filelike object with a maximum length.
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ from keystoneauth1 import exceptions
|
|||||||
from swiftclient import authv1
|
from swiftclient import authv1
|
||||||
|
|
||||||
|
|
||||||
class TestDataNoAccount(object):
|
class TestDataNoAccount:
|
||||||
options = dict(
|
options = dict(
|
||||||
auth_url='http://saio:8080/auth/v1.0',
|
auth_url='http://saio:8080/auth/v1.0',
|
||||||
username='test:tester',
|
username='test:tester',
|
||||||
@ -32,7 +32,7 @@ class TestDataNoAccount(object):
|
|||||||
token = 'token'
|
token = 'token'
|
||||||
|
|
||||||
|
|
||||||
class TestDataWithAccount(object):
|
class TestDataWithAccount:
|
||||||
options = dict(
|
options = dict(
|
||||||
auth_url='http://saio:8080/auth/v1.0',
|
auth_url='http://saio:8080/auth/v1.0',
|
||||||
username='test2:tester2',
|
username='test2:tester2',
|
||||||
|
@ -101,7 +101,7 @@ class TestClientException(unittest.TestCase):
|
|||||||
self.assertIn('(txn: some-other-id)', str(exc))
|
self.assertIn('(txn: some-other-id)', str(exc))
|
||||||
|
|
||||||
|
|
||||||
class MockHttpResponse(object):
|
class MockHttpResponse:
|
||||||
def __init__(self, status=0, headers=None, verify=False):
|
def __init__(self, status=0, headers=None, verify=False):
|
||||||
self.status = status
|
self.status = status
|
||||||
self.status_code = status
|
self.status_code = status
|
||||||
@ -115,7 +115,7 @@ class MockHttpResponse(object):
|
|||||||
self.headers.update(headers)
|
self.headers.update(headers)
|
||||||
self.closed = False
|
self.closed = False
|
||||||
|
|
||||||
class Raw(object):
|
class Raw:
|
||||||
def __init__(self, headers):
|
def __init__(self, headers):
|
||||||
self.headers = headers
|
self.headers = headers
|
||||||
|
|
||||||
@ -586,10 +586,10 @@ class TestGetAuth(MockHttpTest):
|
|||||||
"application_credential_id": "proejct_id",
|
"application_credential_id": "proejct_id",
|
||||||
"application_credential_secret": "secret"}
|
"application_credential_secret": "secret"}
|
||||||
|
|
||||||
class FakeEndpointData(object):
|
class FakeEndpointData:
|
||||||
catalog_url = 'http://swift.cluster/v1/KEY_project_id'
|
catalog_url = 'http://swift.cluster/v1/KEY_project_id'
|
||||||
|
|
||||||
class FakeKeystoneuth1v3Session(object):
|
class FakeKeystoneuth1v3Session:
|
||||||
|
|
||||||
def __init__(self, auth):
|
def __init__(self, auth):
|
||||||
self.auth = auth
|
self.auth = auth
|
||||||
@ -2543,7 +2543,7 @@ class TestConnection(MockHttpTest):
|
|||||||
|
|
||||||
def test_reset_stream(self):
|
def test_reset_stream(self):
|
||||||
|
|
||||||
class LocalContents(object):
|
class LocalContents:
|
||||||
|
|
||||||
def __init__(self, tell_value=0):
|
def __init__(self, tell_value=0):
|
||||||
self.data = io.BytesIO(string.ascii_letters.encode() * 10)
|
self.data = io.BytesIO(string.ascii_letters.encode() * 10)
|
||||||
@ -2565,7 +2565,7 @@ class TestConnection(MockHttpTest):
|
|||||||
self.reads.append((size, read_data))
|
self.reads.append((size, read_data))
|
||||||
return read_data
|
return read_data
|
||||||
|
|
||||||
class LocalConnection(object):
|
class LocalConnection:
|
||||||
|
|
||||||
def __init__(self, parsed_url=None):
|
def __init__(self, parsed_url=None):
|
||||||
self.reason = ""
|
self.reason = ""
|
||||||
|
@ -641,7 +641,7 @@ class TestGetBody(unittest.TestCase):
|
|||||||
self.assertEqual({'test': u'\u2603'}, result)
|
self.assertEqual({'test': u'\u2603'}, result)
|
||||||
|
|
||||||
|
|
||||||
class JSONTracker(object):
|
class JSONTracker:
|
||||||
def __init__(self, data):
|
def __init__(self, data):
|
||||||
self.data = data
|
self.data = data
|
||||||
self.calls = []
|
self.calls = []
|
||||||
|
Loading…
Reference in New Issue
Block a user