internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: ansible/ansible

Issue:
Become with doas not working
##### ISSUE TYPE
- Bug Report
##### ANSIBLE VERSION

```
ansible 2.0.0.2
  config file = /etc/ansible/ansible.cfg
  configured module search path = Default w/o overrides
```
##### CONFIGURATION

```
[privilege_escalation]
become=True
become_method=doas
become_user=root
become_ask_pass=True
```
##### OS / ENVIRONMENT

From: Mac OS X 10.11
To: OpenBSD 5.9 AMD64
##### SUMMARY

The doas prompt definition in play_context.py is incorrect. Currently it is set to 'Password:' but the doas command uses the following layout 'doas (user@host.domain.com) password: ' with user, host and domain replaced with the actual values. When I replace the prompt with the values for my server it will work, however, since it will only work with that particular server this is not an option. I guess that using wildcards would be an option.
##### STEPS TO REPRODUCE

By setting become to doas and sending a ping to the host.

```
ansible host.domain.com -m ping -K
```
##### EXPECTED RESULTS

```
host.domain.com | SUCCESS => {
    "changed": false,
    "ping": "pong"
}
```
##### ACTUAL RESULTS

```
host.domain.com | FAILED! => {
    "failed": true,
    "msg": "ERROR! Timeout (12s) waiting for privilege escalation prompt: \r"
}
```



Discussion:
hmm, it was tested on systems that did return `Password:` see if this patch fixes it for you:

```
diff --git a/lib/ansible/playbook/play_context.py b/lib/ansible/playbook/play_context.py
index a79b4e1..96404f2 100644
--- a/lib/ansible/playbook/play_context.py
+++ b/lib/ansible/playbook/play_context.py
@@ -518,7 +518,7 @@ class PlayContext(Base):

             elif self.become_method == 'doas':

-                prompt = 'Password:'
+                prompt = 'assword:'
                 exe = self.become_exe or 'doas'

                 if not self.become_pass:
```

Initially is used `Password:` but this was changed in December 2015 [1]. Unfortunately your change results in the same error:

```
host.domain.com | FAILED! => {
    "failed": true,
    "msg": "ERROR! Timeout (12s) waiting for privilege escalation prompt: \r"
}
```

[1] http://marc.info/?l=openbsd-cvs&m=144913039401774&w=2

Does anyone know of a workaround? Just encountered this problem myself.

@bendiken add `nopass` to doas.conf . Dirty, but works

prompt = 'doas'
or
prompt = 'doas (%s@' % self.remote_user

would work.

So the issue is that older versions of doas worked with just `Password`, this change would be backwards incompatible, but this might be OK as doas is brand new and I don't expect many users to stay with the older versions.


Resolving patch:
diff --git a/lib/ansible/playbook/play_context.py b/lib/ansible/playbook/play_context.py
--- a/lib/ansible/playbook/play_context.py
+++ b/lib/ansible/playbook/play_context.py
@@ -534,7 +534,7 @@ def detect_su_prompt(data):
 
             elif self.become_method == 'doas':
 
-                prompt = 'Password:'
+                prompt = 'doas (%s@' % self.remote_user
                 exe = self.become_exe or 'doas'
 
                 if not self.become_pass:


Test patch:
Repository: ansible/ansible

Issue:
network _template not checking arguments correctly
##### ISSUE TYPE
- Bug Report
##### COMPONENT NAME

lib/ansible/plugins/action/net_template.py
##### ANSIBLE VERSION

devel
##### CONFIGURATION
##### OS / ENVIRONMENT
##### SUMMARY
##### STEPS TO REPRODUCE

```

---
- name: Backup existing configuration
  eos_template:
    backup: yes
```

No other `vars` set

same for `ios_template`
##### EXPECTED RESULTS

`msg": "missing required arguments: host"` (or src)
##### ACTUAL RESULTS

```
  File "/home/gundalow/git/ansible-inc/ansible/lib/ansible/plugins/action/net_template.py", line 43, in run
    self._handle_template()
  File "/home/gundalow/git/ansible-inc/ansible/lib/ansible/plugins/action/net_template.py", line 80, in _handle_template
    if os.path.isabs(src) or urlparse.urlsplit('src').scheme:
  File "/usr/lib/python2.7/posixpath.py", line 54, in isabs
    return s.startswith('/')
AttributeError: 'NoneType' object has no attribute 'startswith'
```



Discussion:

Resolving patch:
diff --git a/lib/ansible/plugins/action/net_template.py b/lib/ansible/plugins/action/net_template.py
--- a/lib/ansible/plugins/action/net_template.py
+++ b/lib/ansible/plugins/action/net_template.py
@@ -41,7 +41,7 @@ def run(self, tmp=None, task_vars=None):
 
         try:
             self._handle_template()
-        except ValueError as exc:
+        except (ValueError, AttributeError) as exc:
             return dict(failed=True, msg=exc.message)
 
         result.update(self._execute_module(module_name=self._task.action,
@@ -75,9 +75,12 @@ def _write_backup(self, host, contents):
 
     def _handle_template(self):
         src = self._task.args.get('src')
+        if not src:
+            raise ValueError('missing required arguments: src')
+
         working_path = self._get_working_path()
 
-        if os.path.isabs(src) or urlparse.urlsplit('src').scheme:
+        if os.path.isabs(src) or urlparse.urlsplit(src).scheme:
             source = src
         else:
             source = self._loader.path_dwim_relative(working_path, 'templates', src)


Test patch:
Repository: ansible/ansible

Issue:
Ansible fails to create retry files with [Errno 2] No such file or directory: ''
##### ISSUE TYPE
- Bug Report
##### COMPONENT NAME

retry files
##### ANSIBLE VERSION

```
ansible 2.1.1.0
  config file = 
  configured module search path = Default w/o overrides
```
##### CONFIGURATION

none
##### OS / ENVIRONMENT

Ubuntu 16.04
##### SUMMARY

When a playbook fails, Ansible tries to create a retry file and then fails.
##### STEPS TO REPRODUCE

```
# test.yml

---
- hosts: localhost
  gather_facts: no
  tasks:
    - command: "false"
```

Run `ansible-playbook -i localhost, -c local test.yml`
##### EXPECTED RESULTS

Playbook fails, ansible doesn't complain about failing to create `test.retry`.
##### ACTUAL RESULTS

```
PLAY [localhost] ***************************************************************

TASK [command] *****************************************************************
fatal: [localhost]: FAILED! => {"changed": true, "cmd": ["false"], "delta": "0:00:00.001666", "end": "2016-09-08 11:42:55.135782", "failed": true, "rc": 1, "start": "2016-09-08 11:42:55.134116", "stderr": "", "stdout": "", "stdout_lines": [], "warnings": []}

NO MORE HOSTS LEFT *************************************************************
 [WARNING]: Could not create retry file 'test.retry'.         [Errno 2] No such file or directory: ''


PLAY RECAP *********************************************************************
localhost                  : ok=0    changed=0    unreachable=0    failed=1   
```



Discussion:

Resolving patch:
diff --git a/lib/ansible/executor/playbook_executor.py b/lib/ansible/executor/playbook_executor.py
--- a/lib/ansible/executor/playbook_executor.py
+++ b/lib/ansible/executor/playbook_executor.py
@@ -186,7 +186,7 @@ def run(self):
                             if C.RETRY_FILES_SAVE_PATH:
                                 basedir = C.shell_expand(C.RETRY_FILES_SAVE_PATH)
                             elif playbook_path:
-                                basedir = os.path.dirname(playbook_path)
+                                basedir = os.path.dirname(os.path.abspath(playbook_path))
                             else:
                                 basedir = '~/'
 


Test patch:
Repository: ansible/ansible

Issue:
module_utils/openswitch.py - Code review
##### ISSUE TYPE
- Bug Report
##### COMPONENT NAME
##### ANSIBLE VERSION
##### CONFIGURATION
##### OS / ENVIRONMENT
##### SUMMARY
##### STEPS TO REPRODUCE

```
pylint $file
pyflakes $file
```
##### EXPECTED RESULTS

Clean
##### ACTUAL RESULTS

```
W:225, 4: Arguments number differs from overridden 'get_config' method (arguments-differ)
W:246,13: Attribute '_extschema' defined outside __init__ (attribute-defined-outside-init)
W:251,13: Attribute '_extschema' defined outside __init__ (attribute-defined-outside-init)
```



Discussion:

Resolving patch:
diff --git a/lib/ansible/module_utils/openswitch.py b/lib/ansible/module_utils/openswitch.py
--- a/lib/ansible/module_utils/openswitch.py
+++ b/lib/ansible/module_utils/openswitch.py
@@ -73,6 +73,7 @@ def json(self):
         except ValueError:
             return None
 
+
 class Rest(object):
 
     DEFAULT_HEADERS = {
@@ -221,7 +222,7 @@ def configure(self, commands, **kwargs):
         responses = self.execute(cmds)
         return responses[1:]
 
-    def get_config(self):
+    def get_config(self, **kwargs):
         return self.execute('show running-config')[0]
 
     def load_config(self, commands, **kwargs):
@@ -232,6 +233,7 @@ def save_config(self):
 
 Cli = register_transport('cli')(Cli)
 
+
 class Ssh(object):
 
     def __init__(self):
@@ -239,6 +241,7 @@ def __init__(self):
             msg = 'ops.dc lib is required but does not appear to be available'
             raise NetworkError(msg)
         self._opsidl = None
+        self._extschema = None
 
     def configure(self, config):
         if not self._opsidl:
diff --git a/lib/ansible/module_utils/shell.py b/lib/ansible/module_utils/shell.py
--- a/lib/ansible/module_utils/shell.py
+++ b/lib/ansible/module_utils/shell.py
@@ -259,7 +259,7 @@ def run_commands(self, commands):
     def configure(self, commands):
         raise NotImplementedError
 
-    def get_config(self, commands):
+    def get_config(self, **kwargs):
         raise NotImplementedError
 
     def load_config(self, commands, **kwargs):
diff --git a/lib/ansible/module_utils/vyos.py b/lib/ansible/module_utils/vyos.py
--- a/lib/ansible/module_utils/vyos.py
+++ b/lib/ansible/module_utils/vyos.py
@@ -29,7 +29,7 @@
 import re
 
 from ansible.module_utils.network import NetworkModule, NetworkError
-from ansible.module_utils.network import register_transport, to_list, get_exception
+from ansible.module_utils.network import register_transport, to_list
 from ansible.module_utils.shell import CliBase
 
 
@@ -96,7 +96,7 @@ def load_config(self, config, commit=False, comment=None, save=False, **kwargs):
 
         return diff
 
-    def get_config(self, output='text'):
+    def get_config(self, output='text', **kwargs):
         if output not in ['text', 'set']:
             raise ValueError('invalid output format specified')
         if output == 'set':
@@ -104,5 +104,4 @@ def get_config(self, output='text'):
         else:
             return self.execute(['show configuration'])[0]
 
-
 Cli = register_transport('cli', default=True)(Cli)


Test patch:
Repository: ansible/ansible

Issue:
module_utils/nxos.py - Code review
##### ISSUE TYPE
- Bug Report
##### COMPONENT NAME
##### ANSIBLE VERSION
##### CONFIGURATION
##### OS / ENVIRONMENT
##### SUMMARY
##### STEPS TO REPRODUCE

```
pylint $file
pyflakes $file
```
##### EXPECTED RESULTS

Clean
##### ACTUAL RESULTS

```
nxos.py:203: undefined name 'json_dict_bytes_to_unicode'
```



Discussion:

Resolving patch:
diff --git a/lib/ansible/module_utils/nxos.py b/lib/ansible/module_utils/nxos.py
--- a/lib/ansible/module_utils/nxos.py
+++ b/lib/ansible/module_utils/nxos.py
@@ -21,7 +21,7 @@
 import time
 import collections
 
-from ansible.module_utils.basic import json
+from ansible.module_utils.basic import json, json_dict_bytes_to_unicode
 from ansible.module_utils.network import ModuleStub, NetworkError, NetworkModule
 from ansible.module_utils.network import add_argument, register_transport, to_list
 from ansible.module_utils.shell import CliBase
@@ -145,14 +145,14 @@ def execute(self, commands, output=None, **kwargs):
         while commands:
             stack.append(commands.popleft())
             if len(stack) == 10:
-                data = self._get_body(stack, output)
-                data = self._jsonify(data)
+                body = self._get_body(stack, output)
+                data = self._jsonify(body)
                 requests.append(data)
                 stack = list()
 
         if stack:
-            data = self._get_body(stack, output)
-            data = self._jsonify(data)
+            body = self._get_body(stack, output)
+            data = self._jsonify(body)
             requests.append(data)
 
         headers = {'Content-Type': 'application/json'}
@@ -279,12 +279,14 @@ def configure(self, commands, **kwargs):
 
 Cli = register_transport('cli', default=True)(Cli)
 
+
 def prepare_config(commands):
     prepared = ['config']
     prepared.extend(to_list(commands))
     prepared.append('end')
     return prepared
 
+
 def prepare_commands(commands):
     jsonify = lambda x: '%s | json' % x
     for cmd in to_list(commands):


Test patch:
Repository: ansible/ansible

Issue:
module_utils/junos.py - Code review
##### ISSUE TYPE
- Bug Report
##### COMPONENT NAME
##### ANSIBLE VERSION
##### CONFIGURATION
##### OS / ENVIRONMENT
##### SUMMARY
##### STEPS TO REPRODUCE

```
pylint $file
pyflakes $file
```
##### EXPECTED RESULTS

Clean
##### ACTUAL RESULTS

```
E:231,12: Instance of 'Netconf' has no '_error' member (no-member)
W:157,34: Redefining built-in 'format' (redefined-builtin)
W:243, 0: Method 'save_config' is abstract in class 'CliBase' but is not overridden (abstract-method)
W:263,11: Access to a protected member _matched_prompt of a client class (protected-access)
W: 25, 0: Unused NetworkModule imported from ansible.module_utils.network (unused-import)
W: 31, 0: Unused get_module imported from ansible.module_utils.network (unused-import)
C: 53, 4: external import "from lxml import etree" comes before "from ansible.module_utils.pycompat24 import get_exception" (wrong-import-order) # May not be an issue because of ziploader
```



Discussion:
`format` was changed in e5d931de6b5a1334c936e197a1912165de6a37e1

`save_config()` being abstract but not overridden is intentional, and accessing `_matched prompt` is not ideal, but does what it says.

The unused imports are a necessary thing for ziploader to decide the module is important enough to include.


Resolving patch:
diff --git a/lib/ansible/module_utils/junos.py b/lib/ansible/module_utils/junos.py
--- a/lib/ansible/module_utils/junos.py
+++ b/lib/ansible/module_utils/junos.py
@@ -19,7 +19,6 @@
 import re
 import shlex
 
-import re
 from distutils.version import LooseVersion
 
 from ansible.module_utils.pycompat24 import get_exception
@@ -175,7 +174,7 @@ def load_config(self, config, commit=False, replace=False, confirm=None,
         self.lock_config()
 
         try:
-            candidate = '\n'.join(candidate)
+            candidate = '\n'.join(config)
             self.config.load(candidate, format=config_format, merge=merge,
                              overwrite=overwrite)
 
@@ -242,7 +241,7 @@ def rollback_config(self, identifier, commit=True, comment=None):
             self.config.rollback(identifier)
         except ValueError:
             exc = get_exception()
-            self._error('Unable to rollback config: $s' % str(exc))
+            self.raise_exc('Unable to rollback config: $s' % str(exc))
 
         diff = self.config.diff()
         if commit:
@@ -271,12 +270,12 @@ def connect(self, params, **kwargs):
             self.execute('cli')
         self.execute('set cli screen-length 0')
 
-    def configure(self, commands, comment=None):
+    def configure(self, commands, comment=None, **kwargs):
         cmds = ['configure']
         cmds.extend(to_list(commands))
 
         if comment:
-            cmds.append('commit and-quit comment "%s"' % kwargs.get('comment'))
+            cmds.append('commit and-quit comment "%s"' % comment)
         else:
             cmds.append('commit and-quit')
 


Test patch:
Repository: ansible/ansible

Issue:
module_utils/netcfg.py - Code review
##### ISSUE TYPE
- Bug Report
##### COMPONENT NAME
##### ANSIBLE VERSION
##### CONFIGURATION
##### OS / ENVIRONMENT
##### SUMMARY
##### STEPS TO REPRODUCE

```
pylint $file
pyflakes $file
```
##### EXPECTED RESULTS

Clean
##### ACTUAL RESULTS

```
netcfg.py:31: 'shlex' imported but unused
netcfg.py:32: 'time' imported but unused
netcfg.py:34: 'ansible.module_utils.basic.BOOLEANS_FALSE' imported but unused
netcfg.py:34: 'ansible.module_utils.basic.BOOLEANS_TRUE' imported but unused
netcfg.py:55: local variable 'lines' is assigned to but never used
E: 36, 0: Unable to import 'ansible.module_utils.six.moves' (import-error) # May be an issue with my setup, unsure
```



Discussion:

Resolving patch:
diff --git a/lib/ansible/module_utils/netcfg.py b/lib/ansible/module_utils/netcfg.py
--- a/lib/ansible/module_utils/netcfg.py
+++ b/lib/ansible/module_utils/netcfg.py
@@ -51,7 +51,7 @@ def __init__(self, connection):
 
     def __call__(self, commands):
         lines = to_list(commands)
-        return self.connection.configure(commands)
+        return self.connection.configure(lines)
 
     def load_config(self, commands, **kwargs):
         commands = to_list(commands)


Test patch:
Repository: ansible/ansible

Issue:
copy module doesn't follow symbolic directory
##### ISSUE TYPE

Bug Report
##### COMPONENT NAME:

copy action plugin
##### ANSIBLE VERSION

2.0.1.0
##### SUMMARY

I am copying a folder, foo, which has a subfolder, foo1, which is a symbolic link to another folder say /root/myfoo1. copy module won't copy it to remote location.



Discussion:
@justinligraph with which version of Ansible are you seeing this occur?

I can confirm this bug in both 2.0.1.0 (Ubuntu repo) as well as the devel branch from git (pulled today).  

I have attached a small self contained demo.  It copies a directory that includes a couple symlinks to /tmp/ of the local machine.  One symlink is pointed to a file (called "link_to_file"), one is pointed to a directory (called "link_to_dir").  The directory that "link_to_dir" points to never gets copied (dir2), however the file that "link_to_file" points to does (file2).  
[bugtest.tar.gz](https://github.com/ansible/ansible/files/230957/bugtest.tar.gz)


Resolving patch:
diff --git a/lib/ansible/plugins/action/copy.py b/lib/ansible/plugins/action/copy.py
--- a/lib/ansible/plugins/action/copy.py
+++ b/lib/ansible/plugins/action/copy.py
@@ -119,6 +119,10 @@ def run(self, tmp=None, task_vars=None):
                         rel_path = rel_path[1:]
                     source_files.append((full_path, rel_path))
 
+                # recurse into subdirs
+                for sf in sub_folders:
+                    source_files += self._get_recursive_files(os.path.join(source, to_text(sf)), sz=sz)
+
             # If it's recursive copy, destination is always a dir,
             # explicitly mark it so (note - copy module relies on this).
             if not self._connection._shell.path_has_trailing_slash(dest):
@@ -308,6 +312,22 @@ def run(self, tmp=None, task_vars=None):
 
         return result
 
+    def _get_recursive_files(self, topdir, sz=0):
+        ''' Recursively create file tuples for sub folders '''
+        r_files = []
+        for base_path, sub_folders, files in os.walk(to_bytes(topdir)):
+            for fname in files:
+                full_path = to_text(os.path.join(base_path, fname), errors='surrogate_or_strict')
+                rel_path = full_path[sz:]
+                if rel_path.startswith('/'):
+                    rel_path = rel_path[1:]
+                r_files.append((full_path, rel_path))
+
+                for sf in sub_folders:
+                    r_files += self._get_recursive_files(os.path.join(topdir, to_text(sf)), sz=sz)
+
+        return r_files
+
     def _create_content_tempfile(self, content):
         ''' Create a tempfile containing defined content '''
         fd, content_tempfile = tempfile.mkstemp()


Test patch:
Repository: ansible/ansible

Issue:
Using netaddr in Jinja with /32 prefixed address leaves netmask empty
##### ISSUE TYPE
- Bug Report
##### COMPONENT NAME

Jinja2 ipaddr() filter
##### ANSIBLE VERSION

```
ansible 2.1.1.0
  config file = /Users/Yves/Development/dock42-ansible/ansible.cfg
  configured module search path = Default w/o overrides
```
##### CONFIGURATION

N/A
##### OS / ENVIRONMENT

```
OS X Yosemite 10.10.5 (14F1909)

14.5.0 Darwin Kernel Version 14.5.0: Thu Jun 16 19:58:21 PDT 2016; root:xnu-2782.50.4~1/RELEASE_X86_64 x86_64

Python 2.7.10
netaddr 0.7.18

##### SUMMARY
When specifying an address which is prefixed with /32 then the Jinja filter just renders an empty string. Also the Jinja filter does not allow prefixlen as query method - even if the locally installed version supports this method.

netaddr seems to work correctly.

##### STEPS TO REPRODUCE

Try to render this:

{{ 192.168.0.1/32 | ipaddr('netmask') }}
```
##### EXPECTED RESULTS

```
{{ 192.168.0.1/32 | ipaddr('netmask') }}
#255.255.255.255
```
##### ACTUAL RESULTS

```
{{ 192.168.0.1/32 | ipaddr('netmask') }}
# <empty>
```

I verified that netaddr is working correctly.

```
$ python -i
Python 2.7.10 (default, Jul 14 2015, 19:46:27) 
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from netaddr import *
>>> ip = IPNetwork('192.0.0.1/32')
>>> ip.netmask
IPAddress('255.255.255.255')
>>> ip.prefixlen
32
>>> ip = IPNetwork('192.0.0.1/24')
>>> ip.netmask
```

When trying larger prefix length that 32 it works correctly.

```
{{ 192.168.0.1/24 | ipaddr('netmask') }}
#255.255.255.0
```

Also I noticed that _prefixlen_ is not supported as method.

```
prefixlen={{ ipv4 | ipaddr('prefixlen') }} 
# AnsibleFilterError: ipaddr: unknown filter type: prefixlen
```



Discussion:
https://github.com/ansible/ansible/blob/devel/lib/ansible/plugins/filter/ipaddr.py#L166

The size of the network is verified, and if there is nothing in the network, then we return nothing. I am not sure to understand the reasoning here. 


Resolving patch:
diff --git a/lib/ansible/plugins/filter/ipaddr.py b/lib/ansible/plugins/filter/ipaddr.py
--- a/lib/ansible/plugins/filter/ipaddr.py
+++ b/lib/ansible/plugins/filter/ipaddr.py
@@ -163,8 +163,7 @@ def _net_query(v):
             return str(v.network) + '/' + str(v.prefixlen)
 
 def _netmask_query(v):
-    if v.size > 1:
-        return str(v.netmask)
+    return str(v.netmask)
 
 def _network_query(v):
     if v.size > 1:


Test patch:
Repository: ansible/ansible

Issue:
module_utils/a10.py - Code review
##### ISSUE TYPE
- Bug Report
##### COMPONENT NAME

module_utils/a10.py
##### ANSIBLE VERSION

```
  ansible 2.2.0 (devel 70e63ddf6c) last updated 2016/09/15 10:17:19 (GMT +100)
  lib/ansible/modules/core: (devel 683e5e4d1a) last updated 2016/09/15 10:17:22 (GMT +100)
  lib/ansible/modules/extras: (devel 170adf16bd) last updated 2016/09/15 10:17:23 (GMT +100)
```
##### CONFIGURATION
##### OS / ENVIRONMENT
##### SUMMARY

https://github.com/ansible/ansible/commit/b6c30e7985308b3daa0c0b9785bf43a1fcb47f2b
Changed the function signature for axapi_call_v3 from `post` to `method`

However not all instances of calls got changed
E: 94,13: Unexpected keyword argument 'post' in function call (unexpected-keyword-arg)

Does `body` also need setting?
##### STEPS TO REPRODUCE

```
pylint -E module_utils/a10.py
```



Discussion:

Resolving patch:
diff --git a/lib/ansible/module_utils/a10.py b/lib/ansible/module_utils/a10.py
--- a/lib/ansible/module_utils/a10.py
+++ b/lib/ansible/module_utils/a10.py
@@ -91,7 +91,7 @@ def axapi_authenticate(module, base_url, username, password):
 def axapi_authenticate_v3(module, base_url, username, password):
     url = base_url
     auth_payload = {"credentials": {"username": username, "password": password}}
-    result = axapi_call_v3(module, url, post=auth_payload)
+    result = axapi_call_v3(module, url, method='POST', body=auth_payload)
     if axapi_failure(result):
         return module.fail_json(msg=result['response']['err']['msg'])
     signature = result['authresponse']['signature']
@@ -141,4 +141,3 @@ def axapi_get_port_protocol(protocol):
 
 def axapi_get_vport_protocol(protocol):
     return AXAPI_VPORT_PROTOCOLS.get(protocol.lower(), None)
-


Test patch: