mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2024-12-24 08:00:02 -06:00
Require that a host exist before creating a service for it.
This commit is contained in:
parent
bc9684b056
commit
914d2cd4df
@ -141,6 +141,11 @@ class service_add(LDAPCreate):
|
||||
if service.lower() == 'host' and not options['force']:
|
||||
raise errors.HostService()
|
||||
|
||||
try:
|
||||
(hostdn, hostentry) = api.Command['host_show'](hostname, **{})
|
||||
except errors.NotFound:
|
||||
raise errors.NotFound(reason="The host '%s' does not exist to add a service to." % hostname)
|
||||
|
||||
cert = entry_attrs.get('usercertificate')
|
||||
if cert:
|
||||
# FIXME: should be in a normalizer: need to fix normalizers
|
||||
|
Loading…
Reference in New Issue
Block a user