hpcugent / hanythingondemand

hanythingondemand provides a set of scripts to easily set up an ad-hoc Hadoop cluster through PBS jobs
https://hod.readthedocs.org
GNU General Public License v2.0
12 stars 6 forks source link

stop using deprecated .message on exceptions #177

Closed boegel closed 7 years ago

boegel commented 7 years ago

Current output on a faulty hod connect:

$ hod connect foo26345
Connecting to HOD cluster with label 'foo26345'...
/gpfs/scratch/projects/project_gpilot/vsc40023/software/hanythingondemand/3.2.0dev-cli/lib/python2.6/site-packages/hanythingondemand-3.1.4-py2.6.egg/hod/subcommands/connect.py:82: DeprecationWarning: BaseException.message has been deprecated as of Python 2.6
2016-10-20 11:36:40,859 ERROR      not available in optimized mode MainThread  No 'env' file found for cluster with label 'foo26345'

with this patch included, the deprecation warning is gone, leading to a much clearer error message (although there's room for further improvement, especially the 'not available in optimized mode' bit):

$ hod connect foo26345
Connecting to HOD cluster with label 'foo26345'...
2016-10-20 11:45:46,207 ERROR      not available in optimized mode MainThread  No 'env' file found for cluster with label 'foo26345'
boegel commented 7 years ago

@stdweird please review