summaryrefslogtreecommitdiffstats
path: root/ipa-python/rpcclient.py
diff options
context:
space:
mode:
authorSimo Sorce <ssorce@redhat.com>2007-11-18 14:27:25 -0500
committerSimo Sorce <ssorce@redhat.com>2007-11-18 14:27:25 -0500
commitd5c269c8ebf21281348f69840bf60259bbd37cbf (patch)
treed06d52e06e82d9f57874576705960fa32f728085 /ipa-python/rpcclient.py
parentb51f4b28ec86360d27cfb6f529a8e2def500e91f (diff)
parentde5a54ef75473764b91e9e69cbe82c35fac89028 (diff)
downloadfreeipa.git-d5c269c8ebf21281348f69840bf60259bbd37cbf.tar.gz
freeipa.git-d5c269c8ebf21281348f69840bf60259bbd37cbf.tar.xz
freeipa.git-d5c269c8ebf21281348f69840bf60259bbd37cbf.zip
Merge upstream and fix bad suffix in default-aci
Diffstat (limited to 'ipa-python/rpcclient.py')
-rw-r--r--ipa-python/rpcclient.py73
1 files changed, 65 insertions, 8 deletions
diff --git a/ipa-python/rpcclient.py b/ipa-python/rpcclient.py
index 871c3725..c4ca2ff3 100644
--- a/ipa-python/rpcclient.py
+++ b/ipa-python/rpcclient.py
@@ -218,23 +218,32 @@ class RPCClient:
return ipautil.unwrap_binary_data(result)
- def get_add_schema(self):
- """Get the list of attributes we need to ask when adding a new
- user.
- """
+ def get_custom_fields(self):
+ """Get custom user fields."""
server = self.setup_server()
- # FIXME: Hardcoded and designed for the TurboGears GUI. Do we want
- # this for the CLI as well?
try:
- result = server.get_add_schema()
+ result = server.get_custom_fields()
except xmlrpclib.Fault, fault:
raise ipaerror.gen_exception(fault.faultCode, fault.faultString)
except socket.error, (value, msg):
raise xmlrpclib.Fault(value, msg)
return ipautil.unwrap_binary_data(result)
-
+
+ def set_custom_fields(self, schema):
+ """Set custom user fields."""
+ server = self.setup_server()
+
+ try:
+ result = server.set_custom_fields(schema)
+ except xmlrpclib.Fault, fault:
+ raise ipaerror.gen_exception(fault.faultCode, fault.faultString)
+ except socket.error, (value, msg):
+ raise xmlrpclib.Fault(value, msg)
+
+ return ipautil.unwrap_binary_data(result)
+
def get_all_users (self):
"""Return a list containing a User object for each existing user."""
@@ -591,3 +600,51 @@ class RPCClient:
raise xmlrpclib.Fault(value, msg)
return ipautil.unwrap_binary_data(result)
+
+ def get_ipa_config(self):
+ """Get the IPA configuration"""
+ server = self.setup_server()
+ try:
+ result = server.get_ipa_config()
+ except xmlrpclib.Fault, fault:
+ raise ipaerror.gen_exception(fault.faultCode, fault.faultString)
+ except socket.error, (value, msg):
+ raise xmlrpclib.Fault(value, msg)
+
+ return ipautil.unwrap_binary_data(result)
+
+ def update_ipa_config(self, oldconfig, newconfig):
+ """Update the IPA configuration"""
+ server = self.setup_server()
+ try:
+ result = server.update_ipa_config(oldconfig, newconfig)
+ except xmlrpclib.Fault, fault:
+ raise ipaerror.gen_exception(fault.faultCode, fault.faultString)
+ except socket.error, (value, msg):
+ raise xmlrpclib.Fault(value, msg)
+
+ return ipautil.unwrap_binary_data(result)
+
+ def get_password_policy(self):
+ """Get the IPA password policy"""
+ server = self.setup_server()
+ try:
+ result = server.get_password_policy()
+ except xmlrpclib.Fault, fault:
+ raise ipaerror.gen_exception(fault.faultCode, fault.faultString)
+ except socket.error, (value, msg):
+ raise xmlrpclib.Fault(value, msg)
+
+ return ipautil.unwrap_binary_data(result)
+
+ def update_password_policy(self, oldpolicy, newpolicy):
+ """Update the IPA password policy"""
+ server = self.setup_server()
+ try:
+ result = server.update_password_policy(oldpolicy, newpolicy)
+ except xmlrpclib.Fault, fault:
+ raise ipaerror.gen_exception(fault.faultCode, fault.faultString)
+ except socket.error, (value, msg):
+ raise xmlrpclib.Fault(value, msg)
+
+ return ipautil.unwrap_binary_data(result)