Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

code clean of old code from network modules updates #21469

Merged
merged 1 commit into from
Feb 15, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 1 addition & 2 deletions lib/ansible/executor/task_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -768,8 +768,7 @@ def _get_action_handler(self, connection, templar):
elif all((module_prefix in network_group_modules, module_prefix in self._shared_loader_obj.action_loader)):
handler_name = module_prefix
else:
pc_conn = self._shared_loader_obj.connection_loader.get(self._play_context.connection, class_only=True)
handler_name = getattr(pc_conn, 'action_handler', 'normal')
handler_name = 'normal'

handler = self._shared_loader_obj.action_loader.get(
handler_name,
Expand Down
80 changes: 0 additions & 80 deletions lib/ansible/module_utils/local.py

This file was deleted.

133 changes: 0 additions & 133 deletions lib/ansible/modules/network/basics/net_command.py

This file was deleted.

23 changes: 2 additions & 21 deletions lib/ansible/plugins/action/net_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import time
import glob

from ansible.plugins.action.network import ActionModule as _ActionModule
from ansible.plugins.action.normal import ActionModule as _ActionModule
from ansible.module_utils._text import to_text
from ansible.module_utils.six.moves.urllib.parse import urlsplit
from ansible.utils.vars import merge_hash
Expand All @@ -43,10 +43,7 @@ def run(self, tmp=None, task_vars=None):
except ValueError as exc:
return dict(failed=True, msg=exc.message)

if self._play_context.connection == 'local':
result = self.normal(tmp, task_vars)
else:
result = super(ActionModule, self).run(tmp, task_vars)
result = super(ActionModule, self).run(tmp, task_vars)

if self._task.args.get('backup') and result.get('__backup__'):
# User requested backup and no error occurred in module.
Expand All @@ -64,22 +61,6 @@ def run(self, tmp=None, task_vars=None):

return result

def normal(self, tmp=None, task_vars=None):
if task_vars is None:
task_vars = dict()

#results = super(ActionModule, self).run(tmp, task_vars)
# remove as modules might hide due to nolog
#del results['invocation']['module_args']

results = {}
results = merge_hash(results, self._execute_module(tmp=tmp, task_vars=task_vars))

# hack to keep --verbose from showing all the setup module results
if self._task.action == 'setup':
results['_ansible_verbose_override'] = True

return results
def _get_working_path(self):
cwd = self._loader.get_basedir()
if self._task._role is not None:
Expand Down
2 changes: 1 addition & 1 deletion lib/ansible/plugins/action/net_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import urlparse

from ansible.module_utils._text import to_text
from ansible.plugins.action.network import ActionModule as _ActionModule
from ansible.plugins.action.normal import ActionModule as _ActionModule


class ActionModule(_ActionModule):
Expand Down
66 changes: 0 additions & 66 deletions lib/ansible/plugins/action/network.py

This file was deleted.

1 change: 0 additions & 1 deletion lib/ansible/plugins/connection/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ class ConnectionBase(with_metaclass(ABCMeta, object)):
# language means any language.
module_implementation_preferences = ('',)
allow_executable = True
action_handler = 'normal'

def __init__(self, play_context, new_stdin, *args, **kwargs):
# All these hasattrs allow subclasses to override these parameters
Expand Down
1 change: 0 additions & 1 deletion lib/ansible/plugins/connection/network_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ class Connection(_Connection):

transport = 'network_cli'
has_pipelining = False
action_handler = 'network'

def __init__(self, play_context, new_stdin, *args, **kwargs):
super(Connection, self).__init__(play_context, new_stdin, *args, **kwargs)
Expand Down