summaryrefslogtreecommitdiffstats
path: root/ipalib
diff options
context:
space:
mode:
Diffstat (limited to 'ipalib')
-rw-r--r--ipalib/plugins/service.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/ipalib/plugins/service.py b/ipalib/plugins/service.py
index 782948a5a..481a9f6dc 100644
--- a/ipalib/plugins/service.py
+++ b/ipalib/plugins/service.py
@@ -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