Add API to delete a service principal key, service-disable.

I have to do some pretty low-level LDAP work to achieve this. Since
we can't read the key using our modlist generator won't work and lots of
tricks would be needed to use the LDAPUpdate object in any case.

I pulled usercertificate out of the global params and put into each
appropriate function because it makes no sense for service-disable.

This also adds a new variable, has_keytab, to service/host_show output.
This flag tells us whether there is a krbprincipalkey.
This commit is contained in:
Rob Crittenden
2010-07-12 17:45:06 -04:00
parent c9e0b43d53
commit 1e1985b17c
6 changed files with 149 additions and 7 deletions

View File

@@ -112,6 +112,7 @@ class test_host(Declarative):
description=[u'Test host 1'],
l=[u'Undisclosed location 1'],
krbprincipalname=[u'host/%s@%s' % (fqdn1, api.env.realm)],
has_keytab=False
),
),
),
@@ -138,6 +139,7 @@ class test_host(Declarative):
objectclass=objectclasses.host,
managedby=[dn1],
ipauniqueid=[fuzzy_uuid],
has_keytab=False
),
),
),
@@ -220,6 +222,7 @@ class test_host(Declarative):
description=[u'Updated host 1'],
l=[u'Undisclosed location 1'],
krbprincipalname=[u'host/%s@%s' % (fqdn1, api.env.realm)],
has_keytab=False
),
),
),

View File

@@ -93,6 +93,7 @@ class test_service(XMLRPC_test):
"""
entry = api.Command['service_show'](self.principal)['result']
assert_attr_equal(entry, 'krbprincipalname', self.principal)
assert(entry['has_keytab'] == False)
def test_6_service_find(self):
"""

View File

@@ -46,6 +46,8 @@ try:
res = api.Command['user_show'](u'notfound')
except errors.NetworkError:
server_available = False
except IOError:
server_available = False
except errors.NotFound:
server_available = True