Fix backup issue in network config modules and network action plugins common code refactor (#50301)

* Fix backup issue in network config modules

*  Fix `get_working_path` not found issue introduced due to
   backup config code refactor (PR #50208)

*  Further refactor config related action plugins to minimize
   duplicate code

*  Remove unwated imports in config action plugins

* Add common network class for action plugin and related code refactor

* Fix review comment
This commit is contained in:
Ganesh Nalawade 2019-01-04 16:06:13 +05:30 committed by GitHub
parent 8f55e817d2
commit 71113ee291
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
50 changed files with 168 additions and 2347 deletions

View file

@ -22,17 +22,19 @@ __metaclass__ = type
import copy
import sys
from ansible.plugins.action.normal import ActionModule as _ActionModule
from ansible.plugins.action.network import ActionModule as ActionNetworkModule
from ansible.utils.display import Display
display = Display()
class ActionModule(_ActionModule):
class ActionModule(ActionNetworkModule):
def run(self, tmp=None, task_vars=None):
del tmp # tmp no longer has any effect
self._config_module = True if self._task.action == 'netconf_config' else False
if self._play_context.connection not in ['netconf', 'local'] and self._task.action == 'netconf_config':
return {'failed': True, 'msg': 'Connection type %s is not valid for netconf_config module. '
'Valid connection type is netconf or local (deprecated)' % self._play_context.connection}