From 7305a94610599e118c257b11806fa7bf104c4ced Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Wed, 28 Nov 2007 15:17:34 -0500 Subject: Nicely warn when editing objects that do not exist. --- cobbler/commands.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'cobbler') diff --git a/cobbler/commands.py b/cobbler/commands.py index e34e05a..bb801ae 100644 --- a/cobbler/commands.py +++ b/cobbler/commands.py @@ -203,6 +203,8 @@ class CobblerFunction: collect_fn().remove(self.options.name, with_delete=True) return None obj = collect_fn().find(self.options.name) + if obj is None: + raise CX(_("object named (%s) not found") % self.options.name) if not "copy" in self.args and not "rename" in self.args and self.options.name: obj.set_name(self.options.name) -- cgit