Exception.message gone in 3.x (#18221)

* Exception.message gone in 3.x
This commit is contained in:
Nathaniel Case 2016-10-28 13:48:16 -04:00 committed by GitHub
commit 4a067c3f50
3 changed files with 10 additions and 8 deletions

View file

@ -35,6 +35,7 @@ from ansible.module_utils.network import add_argument, register_transport, to_li
from ansible.module_utils.netcli import Command
from ansible.module_utils.shell import CliBase
from ansible.module_utils.urls import fetch_url, url_argument_spec
from ansible.module_utils._text import to_native
EAPI_FORMATS = ['json', 'text']
@ -88,7 +89,7 @@ class EosConfigMixin(object):
self.execute(['no configure session %s' % session])
except NetworkError:
exc = get_exception()
if 'timeout trying to send command' in exc.message:
if 'timeout trying to send command' in to_native(exc):
# try to get control back and get out of config mode
if isinstance(self, Cli):
self.execute(['\x03', 'end'])