Fix various sonarcloud issues

This fixes various reported bugs through sonarcloud at:
https://sonarcloud.io/project/issues?id=Rodney-Reis_ansible&resolved=false&types=BUG
This commit is contained in:
Dag Wieers 2019-02-05 01:44:45 +01:00 committed by Matt Clay
parent f9ab9b4d68
commit c2fb581414
12 changed files with 15 additions and 70 deletions

View file

@ -1,19 +1,6 @@
# (c) 2015, Ansible Inc,
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
# Copyright: (c) 2015, Ansible Inc,
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
@ -64,7 +51,7 @@ class ActionModule(ActionBase):
play_context.connection = 'netconf'
play_context.port = int(self.provider['port'] or self._play_context.port or 830)
elif self.provider.get('transport') in ('nxapi', 'eapi') and play_context.network_os in ('nxos', 'eos'):
play_context.connection = play_context.connection
play_context.connection = 'local'
play_context.port = int(self.provider['port'] or self._play_context.port or 22)
else:
play_context.connection = 'network_cli'