title: Ansible InventoryManager subset method throwing TypeError
body: <p>I am using python to run ansible-playbook programmatically. I trying to test with simple playbook that ping localhost.</p>
  
  <p>But when I use subset method from ansible.vars.manager import VariableManager I am getting NoneType error</p>
  
  <p>Below my code</p>
  
  <pre><code>from ansible import context
  from ansible.module_utils.common.collections import ImmutableDict
  from ansible.executor.playbook_executor import PlaybookExecutor
  from ansible.parsing.dataloader import DataLoader
  from ansible.inventory.manager import InventoryManager
  from ansible.vars.manager import VariableManager
  
  loader = DataLoader()
  inventory = InventoryManager(loader=loader, sources="localhost,")
  inventory.subset('x.x.x.x')
  variable_manager = VariableManager(loader=loader, inventory=inventory)
  variable_manager._extra_vars = {'customer': 'test'}
  passwords = {}
  context.CLIARGS = ImmutableDict(tags={}, listtags=False, listtasks=False, listhosts=False, syntax=False,
                                      module_path=None, forks=100, private_key_file=None,
                                      ssh_common_args=None, ssh_extra_args=None, sftp_extra_args=None, scp_extra_args=None, become=False,
                                      become_method='sudo', become_user='root', verbosity=True, check=False, start_at_task=None)
  
  playbook = PlaybookExecutor(playbooks=['/Users/Admin/Desktop/Repositories/ansible-playbooks/test.yml'],
                              inventory=inventory,
                              variable_manager=variable_manager,
                              loader=loader, passwords=passwords)
  
  playbook.run()
  </code></pre>
  
  <p>Error I get</p>
  
  <pre><code>$ python3 testAnsible.py 
  Traceback (most recent call last):
    File "testAnsible.py", line 14, in &lt;module&gt;
      inventory.subset('x.x.x.x')
  TypeError: 'NoneType' object is not callable
  </code></pre>
  
  <p>I am using python3.8.2 and ansible 2.9.6
  Could you please help me to fix this? I took a look at <a href="https://github.com/ansible/ansible/blob/b4d66c49914cdf6744f72692874830c03559b2f9/lib/ansible/inventory/manager.py#L600" rel="nofollow noreferrer">https://github.com/ansible/ansible/blob/b4d66c49914cdf6744f72692874830c03559b2f9/lib/ansible/inventory/manager.py#L600</a> there is subset method. I do not understood why I am getting Type Error</p>