diff options
Diffstat (limited to 'macaroonbakery/httpbakery/agent.py')
-rw-r--r-- | macaroonbakery/httpbakery/agent.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/macaroonbakery/httpbakery/agent.py b/macaroonbakery/httpbakery/agent.py index 3676bae..e5a09e4 100644 --- a/macaroonbakery/httpbakery/agent.py +++ b/macaroonbakery/httpbakery/agent.py @@ -1,6 +1,5 @@ # Copyright 2017 Canonical Ltd. # Licensed under the LGPLv3, see LICENCE file for details. - import base64 import json @@ -12,20 +11,20 @@ from six.moves.urllib.parse import urlparse class AgentFileFormatError(Exception): - """ AgentFileFormatError is the exception raised when an agent file has a bad + ''' AgentFileFormatError is the exception raised when an agent file has a bad structure. - """ + ''' pass def load_agent_file(filename, cookies=None): - """ Loads agent information from the specified file. + ''' Loads agent information from the specified file. The agent cookies are added to cookies, or a newly created cookie jar if cookies is not specified. The updated cookies is returned along with the private key associated with the agent. These can be passed directly as the cookies and key parameter to BakeryAuth. - """ + ''' with open(filename) as f: data = json.load(f) @@ -50,4 +49,4 @@ def load_agent_file(filename, cookies=None): cookies.set_cookie(cookie) return cookies, key except (KeyError, ValueError) as e: - raise AgentFileFormatError("invalid agent file", e) + raise AgentFileFormatError('invalid agent file', e) |