Adds hasattr checks for rpc calls used in network_cli plugins (#49173)

Network platforms that don't have cliconf plugin will fail when
sending rpc calls for the reset_history and disable_response_logging
functions because those are defined in cliconf exclusively at this
time.

This patch adds checks for those attributes before making the call
This commit is contained in:
Tim Rupp 2018-11-26 20:59:03 -08:00 committed by GitHub
parent 8796085569
commit 0b5b5e69d8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -294,8 +294,11 @@ class Connection(NetworkConnectionBase):
self._play_context = play_context self._play_context = play_context
if hasattr(self, 'reset_history'):
self.reset_history() self.reset_history()
if hasattr(self, 'disable_response_logging'):
self.disable_response_logging() self.disable_response_logging()
return messages return messages
def _connect(self): def _connect(self):