opengear / opengear.om

Ansible Network Collection for Opengear OM
GNU General Public License v3.0
8 stars 7 forks source link

Hardcoded path to `structure.json` #3

Closed allarm closed 8 months ago

allarm commented 3 years ago

Hardcoded path to structure.json in /opengear/om/plugins/module_utils/network/om/utils/utils.py

/opengear/om/plugins/module_utils/network/om/utils/utils.py:

def get_restapi_body_structure():
    with open('/home/avankat/Documents/automated-device-config/opengear.om/'
              'plugins/module_utils/network/om/utils/structure.json') as file:
        return json.load(file)

I don't have sufficient knowledge of Ansible internals to fix this one - I assume there should be a list of paths to Ansible collections instead of the hard coded path.

ansible --version
ansible 2.10.2
  config file = None
  configured module search path = ['/Users/allarm/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /Users/allarm/.virtualenvs/default/lib/python3.8/site-packages/ansible
  executable location = /Users/allarm/.virtualenvs/default/bin/ansible
  python version = 3.8.2 (default, Aug 10 2020, 05:49:21) [Clang 12.0.0 (clang-1200.0.31.1)]

Thank you.

mattwit commented 8 months ago

Updated and merged.