Show More
@@ -153,25 +153,25 b' class CrowdServer(object):' | |||
|
153 | 153 | global msg |
|
154 | 154 | msg = "" |
|
155 | 155 | try: |
|
156 | rdoc = self.opener.open(request) | |
|
157 |
msg = |
|
|
156 | ret_doc = self.opener.open(request) | |
|
157 | msg = ret_doc.read() | |
|
158 | 158 | if not msg and empty_response_ok: |
|
159 | rval = {} | |
|
160 | rval["status"] = True | |
|
161 | rval["error"] = "Response body was empty" | |
|
159 | ret_val = {} | |
|
160 | ret_val["status"] = True | |
|
161 | ret_val["error"] = "Response body was empty" | |
|
162 | 162 | elif not noformat: |
|
163 | rval = json.loads(msg) | |
|
164 | rval["status"] = True | |
|
163 | ret_val = json.loads(msg) | |
|
164 | ret_val["status"] = True | |
|
165 | 165 | else: |
|
166 |
rval = |
|
|
166 | ret_val = msg | |
|
167 | 167 | except Exception as e: |
|
168 | 168 | if not noformat: |
|
169 | rval = {"status": False, | |
|
170 | "body": body, | |
|
171 |
"error": |
|
|
169 | ret_val = {"status": False, | |
|
170 | "body": body, | |
|
171 | "error": "{}\n{}".format(e, msg)} | |
|
172 | 172 | else: |
|
173 | rval = None | |
|
174 | return rval | |
|
173 | ret_val = None | |
|
174 | return ret_val | |
|
175 | 175 | |
|
176 | 176 | def user_auth(self, username, password): |
|
177 | 177 | """Authenticate a user against crowd. Returns brief information about |
General Comments 0
You need to be logged in to leave comments.
Login now