Cleanup deprecated exception checking

Exception.message is deprecated in python2.6 and removed in python3.
Switch use of that to str(Exception) instead to use non deprecated code
paths.

Change-Id: I040d650c277454a9170ca256c0a936d928a81f95
This commit is contained in:
Clark Boylan 2015-10-07 17:06:43 -07:00
parent 2df3683358
commit 9e60d69a01
1 changed files with 2 additions and 2 deletions

View File

@ -39,7 +39,7 @@ def delete_offline_nodes(server, timeout):
except jenkins.NotFoundException:
pass
except jenkins.JenkinsException as e:
if '[500]' in e.message:
if '[500]' in str(e):
pass
else:
raise
@ -78,7 +78,7 @@ def main():
except jenkins.NotFoundException:
pass
except jenkins.JenkinsException as e:
if '[500]' in e.message:
if '[500]' in str(e):
pass
else:
raise