Creates an update_entry api call, aliases update_user and update_group to it.
This commit is contained in:
1 parent
63f7cdf7f7
commit
fbbdd27b53
5 files changed
+28
-8
No files matched your search
@@ -78,6 +78,12 @@ class IPAClient:
|
||||
result = self.transport.get_entry_by_cn(cn,sattrs)
|
||||
return entity.Entity(result)
|
||||
|
||||
def update_entry(self,entry):
|
||||
"""Update a entry."""
|
||||
|
||||
result = self.transport.update_entry(entry.origDataDict(), entry.toDict())
|
||||
return result
|
||||
|
||||
# User support
|
||||
def get_user_by_uid(self,uid,sattrs=None):
|
||||
"""Get a specific user by uid. If sattrs is set then only those
|
||||
|
||||
@@ -118,6 +118,20 @@ class RPCClient:
|
||||
|
||||
return ipautil.unwrap_binary_data(result)
|
||||
|
||||
def update_entry(self,oldentry,newentry):
|
||||
"""Update an existing entry. oldentry and newentry are dicts of attributes"""
|
||||
server = self.setup_server()
|
||||
|
||||
try:
|
||||
result = server.update_entry(ipautil.wrap_binary_data(oldentry),
|
||||
ipautil.wrap_binary_data(newentry))
|
||||
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)
|
||||
|
||||
|
||||
# User support
|
||||
|
||||
|
||||
Reference in new issue
Block a user