Repository: ansible-collections/community.general

Issue:
community.general.jira: Can't create tickets in 2.5.0
### Summary

The new 2.5.0 package came out earlier today. Tried to test out fixes in this package for community.general.jira, but it looks like now tickets can't be created now and complains with the following error:
```
TypeError: isinstance expected 2 arguments, got 1
```
Which looks to be an issue with the underling python code.  Here is the back to back results from running it with 2.4.0 and then again with 2.5.0

```
[root@a188fad95d12 Code]# ansible-galaxy collection list community.general

# /usr/local/lib/python3.6/site-packages/ansible_collections
Collection        Version
----------------- -------
community.general 1.3.2  

# /root/.ansible/collections/ansible_collections
Collection        Version
----------------- -------
community.general 2.4.0  
[root@a188fad95d12 Code]# ansible-playbook playbooks/dumbPSCM.yml -i inventories/us/onprem/internal/dev/d1ldpelliccia.yml --ask-vault-pass --private-key=/ssh/cool_key4
Vault password: 

PLAY [all] *************************************************************************************************************************************************************************************************************************************************************
Tuesday 13 April 2021  19:35:54 +0000 (0:00:00.187)       0:00:00.187 ********* 

TASK [Create DevOps Ticket] ********************************************************************************************************************************************************************************************************************************************
changed: [d1l01dpelliccia.cl.local]
Tuesday 13 April 2021  19:35:55 +0000 (0:00:00.953)       0:00:01.140 ********* 

TASK [debug] ***********************************************************************************************************************************************************************************************************************************************************
ok: [d1l01dpelliccia.cl.local] => 
  jiraGetTicketBySummary_devops:
    changed: true
    failed: false
    meta:
      id: '145839'
      key: DEVOPS-6364
      self: http://jira.contoso.com/rest/api/2/issue/145839

PLAY RECAP *************************************************************************************************************************************************************************************************************************************************************
d1l01dpelliccia.cl.local   : ok=2    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   

Tuesday 13 April 2021  19:35:55 +0000 (0:00:00.396)       0:00:01.537 ********* 
=============================================================================== 
Create DevOps Ticket -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 0.95s
debug ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 0.40s
[root@a188fad95d12 Code]#
```

############################## 2.5.0 ############################

```
[root@1a5abb9a9ed1 Code]# ansible-galaxy collection list community.general

# /usr/local/lib/python3.6/site-packages/ansible_collections
Collection        Version
----------------- -------
community.general 1.3.2  

# /root/.ansible/collections/ansible_collections
Collection        Version
----------------- -------
community.general 2.5.0  
[root@1a5abb9a9ed1 Code]# ansible-playbook playbooks/dumbPSCM.yml -i inventories/us/onprem/internal/dev/d1ldpelliccia.yml --ask-vault-pass --private-key=/ssh/cool_key4
Vault password: 

PLAY [all] *************************************************************************************************************************************************************************************************************************************************************
Tuesday 13 April 2021  19:36:58 +0000 (0:00:00.315)       0:00:00.315 ********* 

TASK [Create DevOps Ticket] ********************************************************************************************************************************************************************************************************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: TypeError: isinstance expected 2 arguments, got 1
fatal: [d1l01dpelliccia.cl.local]: FAILED! => changed=false 
  msg: isinstance expected 2 arguments, got 1
...ignoring
Tuesday 13 April 2021  19:36:59 +0000 (0:00:01.706)       0:00:02.021 ********* 

TASK [debug] ***********************************************************************************************************************************************************************************************************************************************************
ok: [d1l01dpelliccia.cl.local] => 
  jiraGetTicketBySummary_devops:
    changed: false
    exception: |-
      Traceback (most recent call last):
        File "/tmp/ansible_community.general.jira_payload_Uh4cGi/ansible_community.general.jira_payload.zip/ansible_collections/community/general/plugins/modules/jira.py", line 688, in main
        File "/tmp/ansible_community.general.jira_payload_Uh4cGi/ansible_community.general.jira_payload.zip/ansible_collections/community/general/plugins/modules/jira.py", line 456, in create
        File "/tmp/ansible_community.general.jira_payload_Uh4cGi/ansible_community.general.jira_payload.zip/ansible_collections/community/general/plugins/modules/jira.py", line 428, in post
        File "/tmp/ansible_community.general.jira_payload_Uh4cGi/ansible_community.general.jira_payload.zip/ansible_collections/community/general/plugins/modules/jira.py", line 392, in request
      TypeError: isinstance expected 2 arguments, got 1
    failed: true
    msg: isinstance expected 2 arguments, got 1

PLAY RECAP *************************************************************************************************************************************************************************************************************************************************************
d1l01dpelliccia.cl.local   : ok=2    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=1   

Tuesday 13 April 2021  19:37:00 +0000 (0:00:00.478)       0:00:02.500 *********
```

### Issue Type

Bug Report

### Component Name

community.general.jira

### Ansible Version

```console (paste below)
[root@1a5abb9a9ed1 Code]# ansible --version
ansible 2.10.8
  config file = /ansible/ansible/Code/ansible.cfg
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.6/site-packages/ansible
  executable location = /usr/local/bin/ansible
  python version = 3.6.8 (default, Nov 16 2020, 16:55:22) [GCC 4.8.5 20150623 (Red Hat 4.8.5-44)]
```


### Configuration

```console (paste below)
[root@1a5abb9a9ed1 Code]# ansible-config dump --only-changed
ANSIBLE_NOCOWS(/ansible/ansible/Code/ansible.cfg) = True
ANSIBLE_PIPELINING(/ansible/ansible/Code/ansible.cfg) = True
ANSIBLE_SSH_ARGS(/ansible/ansible/Code/ansible.cfg) = -C -o ControlMaster=auto -o ControlPersist=60s
ANSIBLE_SSH_CONTROL_PATH(/ansible/ansible/Code/ansible.cfg) = /dev/shm/cp%%h-%%p-%%r
ANY_ERRORS_FATAL(/ansible/ansible/Code/ansible.cfg) = True
DEFAULT_CALLBACK_PLUGIN_PATH(/ansible/ansible/Code/ansible.cfg) = ['/ansible/ansible/Code/plugins', '/datadog_callback']
DEFAULT_CALLBACK_WHITELIST(/ansible/ansible/Code/ansible.cfg) = ['ansible.posix.profile_tasks', 'datadog_callback']
DEFAULT_FORKS(/ansible/ansible/Code/ansible.cfg) = 50
DEFAULT_GATHER_TIMEOUT(/ansible/ansible/Code/ansible.cfg) = 60
DEFAULT_MANAGED_STR(/ansible/ansible/Code/ansible.cfg) = Ansible managed: {file} modified on %Y-%m-%d %H:%M:%S by {uid} on {host}
DEFAULT_POLL_INTERVAL(/ansible/ansible/Code/ansible.cfg) = 5
DEFAULT_ROLES_PATH(/ansible/ansible/Code/ansible.cfg) = ['/ansible/ansible/Code/roles']
DEFAULT_STDOUT_CALLBACK(/ansible/ansible/Code/ansible.cfg) = community.general.yaml
DEFAULT_TIMEOUT(/ansible/ansible/Code/ansible.cfg) = 60
DISPLAY_SKIPPED_HOSTS(/ansible/ansible/Code/ansible.cfg) = False
HOST_KEY_CHECKING(/ansible/ansible/Code/ansible.cfg) = False
PERSISTENT_COMMAND_TIMEOUT(/ansible/ansible/Code/ansible.cfg) = 3600
SHOW_CUSTOM_STATS(/ansible/ansible/Code/ansible.cfg) = True
USE_PERSISTENT_CONNECTIONS(/ansible/ansible/Code/ansible.cfg) = True

```


### OS / Environment

CentOS 7

### Steps to Reproduce

<!--- Paste example playbooks or commands between quotes below -->
```yaml (paste below)
- hosts: all
  gather_facts: false
  vars:
    jiraGetTicketBySummary_epic: "SS-58"
  tasks:
  - name: Create DevOps Ticket
    community.general.jira:
      uri: 'http://jira.contoso.com'
      username: 'user'
      password: '***'
      project: DEVOPS
      operation: create
      summary: 'testing 1 2 3'
      description: 'Do I work?'
      issuetype: "Story"
      validate_certs: no
    args:
      fields:
        customfield_10006: '{{ jiraGetTicketBySummary_epic }}'
    register: jiraGetTicketBySummary_devops
    ignore_errors: true
  
  - debug:
      var: jiraGetTicketBySummary_devops
```


### Expected Results
```
ok: [d1l01dpelliccia.cl.local] => 
  jiraGetTicketBySummary_devops:
    changed: true
    failed: false
    meta:
      id: '145839'
      key: DEVOPS-6364
      self: http://jira.contoso.com/rest/api/2/issue/145839
```

### Actual Results

```console (paste below)
TASK [debug] ***********************************************************************************************************************************************************************************************************************************************************
ok: [d1l01dpelliccia.cl.local] => 
  jiraGetTicketBySummary_devops:
    changed: false
    exception: |-
      Traceback (most recent call last):
        File "/tmp/ansible_community.general.jira_payload_Uh4cGi/ansible_community.general.jira_payload.zip/ansible_collections/community/general/plugins/modules/jira.py", line 688, in main
        File "/tmp/ansible_community.general.jira_payload_Uh4cGi/ansible_community.general.jira_payload.zip/ansible_collections/community/general/plugins/modules/jira.py", line 456, in create
        File "/tmp/ansible_community.general.jira_payload_Uh4cGi/ansible_community.general.jira_payload.zip/ansible_collections/community/general/plugins/modules/jira.py", line 428, in post
        File "/tmp/ansible_community.general.jira_payload_Uh4cGi/ansible_community.general.jira_payload.zip/ansible_collections/community/general/plugins/modules/jira.py", line 392, in request
      TypeError: isinstance expected 2 arguments, got 1
    failed: true
    msg: isinstance expected 2 arguments, got 1

```


### Code of Conduct

I agree to follow the Ansible Code of Conduct


Discussion:
Files identified in the description:
None

If these files are inaccurate, please update the `component name` section of the description or use the `!component` bot command.

[click here for bot help](https://github.com/ansible/ansibullbot/blob/master/ISSUE_HELP.md)
<!--- boilerplate: components_banner --->
@zraider7 yup, as we had no tests whatsoever for this module, a silly bug like made it through the cracks (the cracks of my eyes too - I was one of the folks reviewing the PR that introduced that bug and I missed it). PR #2208 adds some integration tests but they still fall short, I will add unit tests there as well.

Resolving patch:
diff --git a/plugins/modules/web_infrastructure/jira.py b/plugins/modules/web_infrastructure/jira.py
--- a/plugins/modules/web_infrastructure/jira.py
+++ b/plugins/modules/web_infrastructure/jira.py
@@ -389,7 +389,7 @@ def request(
     auth = to_text(base64.b64encode(to_bytes('{0}:{1}'.format(user, passwd), errors='surrogate_or_strict')))
 
     headers = {}
-    if isinstance(additional_headers) == dict:
+    if isinstance(additional_headers, dict):
         headers = additional_headers.copy()
     headers.update({
         "Content-Type": content_type,


Test patch: