Add UI for service principal creation and keytab retrieval
This commit is contained in:
1 parent
c397041bfa
commit
15b7dc6ff9
12 files changed
+498
-2
No files matched your search
@@ -385,6 +385,20 @@ class IPAClient:
|
||||
def add_service_principal(self, princ_name):
|
||||
return self.transport.add_service_principal(princ_name)
|
||||
|
||||
def find_service_principal(self, criteria, sattrs=None, searchlimit=0, timelimit=-1):
|
||||
"""Return a list: counter followed by a Entity object for each host that
|
||||
matches the criteria. If the results are truncated, counter will
|
||||
be set to -1"""
|
||||
result = self.transport.find_service_principal(criteria, sattrs, searchlimit, timelimit)
|
||||
counter = result[0]
|
||||
|
||||
hosts = [counter]
|
||||
for attrs in result[1:]:
|
||||
if attrs is not None:
|
||||
hosts.append(entity.Entity(attrs))
|
||||
|
||||
return hosts
|
||||
|
||||
def get_keytab(self, princ_name):
|
||||
return self.transport.get_keytab(princ_name)
|
||||
|
||||
@@ -703,6 +703,24 @@ class RPCClient:
|
||||
|
||||
return ipautil.unwrap_binary_data(result)
|
||||
|
||||
def find_service_principal (self, criteria, sattrs=None, searchlimit=0, timelimit=-1):
|
||||
"""Return a list: counter followed by a Entity object for each host that
|
||||
matches the criteria. If the results are truncated, counter will
|
||||
be set to -1"""
|
||||
|
||||
server = self.setup_server()
|
||||
try:
|
||||
# None values are not allowed in XML-RPC
|
||||
if sattrs is None:
|
||||
sattrs = "__NONE__"
|
||||
result = server.find_service_principal(criteria, sattrs, searchlimit, timelimit)
|
||||
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_keytab(self, princ_name):
|
||||
server = self.setup_server()
|
||||
|
||||
|
||||
Reference in new issue
Block a user