diff options
| author | makkalot <makkalot@gmail.com> | 2008-08-06 14:15:12 +0300 |
|---|---|---|
| committer | makkalot <makkalot@gmail.com> | 2008-08-06 14:15:12 +0300 |
| commit | ee6f808c97ae4336c79e34e56d7d5eca97efc0ea (patch) | |
| tree | e048be309e3d69fa22a4690caa7d39baf19dc6f6 /funcweb | |
| parent | 40466d5a1e73e96df503f6707c51b8cdf4dbce99 (diff) | |
| download | func-ee6f808c97ae4336c79e34e56d7d5eca97efc0ea.tar.gz func-ee6f808c97ae4336c79e34e56d7d5eca97efc0ea.tar.xz func-ee6f808c97ae4336c79e34e56d7d5eca97efc0ea.zip | |
add some error handling
Diffstat (limited to 'funcweb')
| -rw-r--r-- | funcweb/funcweb/controllers.py | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/funcweb/funcweb/controllers.py b/funcweb/funcweb/controllers.py index bc6206d..32cde3f 100644 --- a/funcweb/funcweb/controllers.py +++ b/funcweb/funcweb/controllers.py @@ -460,8 +460,12 @@ class Funcweb(object): else: fc_async = self.func_cache['fc_async_obj'] - - id_result = fc_async.job_status(job_id) + + try: + id_result = fc_async.job_status(job_id) + except Exception,e: + flash("We encountered some error while getting the status for %s job id"%(job_id)) + return dict() #the final id_result return dict(result=id_result) @@ -546,11 +550,15 @@ class Funcweb(object): copy_group_name = copy(group_name) if not group_name.startswith('@'): group_name = "".join(["@",group_name.strip()]) - - minion_api = Minions("*") - hosts = minion_api.group_class.get_hosts_by_group_glob(group_name) - all_minions = minion_api.get_all_hosts() - del minion_api + + try: + minion_api = Minions("*") + hosts = minion_api.group_class.get_hosts_by_group_glob(group_name) + all_minions = minion_api.get_all_hosts() + del minion_api + except Exception,e: + flash("We encountered some error while getting host list for %s "%(copy_group_name)) + return dict() #store the current group_name in cache variable self.group_name = copy_group_name |
