Fix sanity errors for collections

This commit is contained in:
beeankha
2021-07-29 16:36:29 -04:00
parent d89719c740
commit e88e81928c
5 changed files with 14 additions and 11 deletions

View File

@@ -72,6 +72,7 @@ from ansible.errors import AnsibleParserError, AnsibleOptionsError
from ansible.plugins.inventory import BaseInventoryPlugin
from ansible.config.manager import ensure_type
from ansible.module_utils.six import raise_from
from ..module_utils.controller_api import ControllerAPIModule
@@ -130,9 +131,9 @@ class InventoryModule(BaseInventoryPlugin):
try:
inventory_id = ensure_type(inventory_id, 'str')
except ValueError as e:
raise AnsibleOptionsError(
raise_from(AnsibleOptionsError(
'Invalid type for configuration option inventory_id, ' 'not integer, and cannot convert to string: {err}'.format(err=to_native(e))
) from e
), e)
inventory_id = inventory_id.replace('/', '')
inventory_url = '/api/v2/inventories/{inv_id}/script/'.format(inv_id=inventory_id)