diff options
author | Michael DeHaan <mdehaan@redhat.com> | 2006-09-29 14:12:44 -0400 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2006-09-29 14:12:44 -0400 |
commit | c40ccd5385dd989540be60b85eee1a4a552515f9 (patch) | |
tree | 307fa7d639aa415c61770705603a9dc77e00fc24 /cobbler | |
parent | 1d9b0343abaf2b23e177e3c56f19f182f2299182 (diff) | |
download | third_party-cobbler-c40ccd5385dd989540be60b85eee1a4a552515f9.tar.gz third_party-cobbler-c40ccd5385dd989540be60b85eee1a4a552515f9.tar.xz third_party-cobbler-c40ccd5385dd989540be60b85eee1a4a552515f9.zip |
Added some extra error checking to enchant.
Diffstat (limited to 'cobbler')
-rw-r--r-- | cobbler/action_enchant.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/cobbler/action_enchant.py b/cobbler/action_enchant.py index dcf583d..b095875 100644 --- a/cobbler/action_enchant.py +++ b/cobbler/action_enchant.py @@ -47,6 +47,10 @@ class Enchant: Replace the OS of a remote system. """ koan = os.path.basename(self.settings.koan_path) + pro = self.config.profiles().find(self.profile) + if pro is None: + raise cexceptions.CobblerException("enchant_failed","no such profile: %s" % self.profile) + try: ssh = self.ssh = pxssh.pxssh() if not ssh.login(self.sysname, self.username, self.password): @@ -58,6 +62,6 @@ class Enchant: return True except: traceback.print_exc() - return False + raise cexceptions.CobblerException("enchant_failed","exception") return False # shouldn't be here |