summaryrefslogtreecommitdiffstats
path: root/pykolab/wap_client/__init__.py
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2014-05-14 14:05:56 +0200
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2014-05-14 14:05:56 +0200
commit4583e353fcb16fb5de8f2e83d11173d1f784b80a (patch)
tree8ae07f0f72ffc78c8e90445d03922d4bab1a6728 /pykolab/wap_client/__init__.py
parent58674fa2c72a8a6f230d787db9444d279f951ba5 (diff)
downloadpykolab-4583e353fcb16fb5de8f2e83d11173d1f784b80a.tar.gz
Use 'id' rather than 'user' parameter
Diffstat (limited to 'pykolab/wap_client/__init__.py')
-rw-r--r--pykolab/wap_client/__init__.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/pykolab/wap_client/__init__.py b/pykolab/wap_client/__init__.py
index 54ef541..b7ac1e9 100644
--- a/pykolab/wap_client/__init__.py
+++ b/pykolab/wap_client/__init__.py
@@ -312,6 +312,8 @@ def request_raw(method, api_uri, get=None, post=None, headers={}):
if conf.debuglevel > 8:
conn.set_debuglevel(9)
+ conn.set_debuglevel(9)
+
if not get == None:
_get = "?%s" % (urllib.urlencode(get))
else:
@@ -326,6 +328,7 @@ def request_raw(method, api_uri, get=None, post=None, headers={}):
data = response.read()
log.debug(_("Got response: %r") % (data), level=8)
+
try:
response_data = json.loads(data)
except ValueError, e:
@@ -362,7 +365,7 @@ def user_add(params=None):
def user_delete(params=None):
if params == None:
params = {
- 'user': utils.ask_question("Username for user to delete", "user")
+ 'id': utils.ask_question("Username for user to delete", "user")
}
post = json.dumps(params)
@@ -372,11 +375,11 @@ def user_delete(params=None):
def user_edit(user = None, attributes={}):
if user == None:
get = {
- 'user': utils.ask_question("Username for user to edit", "user")
+ 'id': utils.ask_question("Username for user to edit", "user")
}
else:
get = {
- 'user': user
+ 'id': user
}
user_info = request('GET', 'user.info', get=get)
@@ -514,8 +517,11 @@ def user_form_value_generate_userpassword(*args, **kw):
def user_info(user=None):
if user == None:
user = utils.ask_question("User email address")
- _params = { 'user': user }
+
+ _params = { 'id': user }
+
user = request('GET', 'user.info', get=_params)
+
return user
def user_types_list():