Skip to content

Remove global timeout #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions akamai/netstorage/netstorage.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,14 @@ class NetstorageError(Exception):


class Netstorage:
def __init__(self, hostname, keyname, key, ssl=False, timeout=None):
def __init__(self, hostname, keyname, key, ssl=False):
if not (hostname and keyname and key):
raise NetstorageError('[NetstorageError] You should input netstorage hostname, keyname and key all')

self.hostname = hostname
self.keyname = keyname
self.key = key
self.ssl = 's' if ssl else ''
self.timeout = timeout
self.http_client = requests.Session()


Expand Down Expand Up @@ -107,7 +106,7 @@ def _request(self, **kwargs):
'User-Agent': 'NetStorageKit-Python'
}

timeout = kwargs['timeout'] if 'timeout' in kwargs else self.timeout
timeout = kwargs['timeout'] if 'timeout' in kwargs else None

response = None
if kwargs['method'] == 'GET':
Expand Down
3 changes: 1 addition & 2 deletions cms_netstorage.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,7 @@ def print_result(response, action):

if options.hostname and options.keyname and options.key and options.action:
ssl = options.ssl if hasattr(options, 'ssl') else False
timeout = options.timeout if hasattr(options, 'timeout') else None
ns = Netstorage(options.hostname, options.keyname, options.key, ssl, timeout)
ns = Netstorage(options.hostname, options.keyname, options.key, ssl)

def _arg(key, default=None):
return args[key] if key in args else default
Expand Down