mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-28 03:00:23 -07:00
Fixes bugs in iapp template (#33478)
Fixes upstream bugs that broke downstream. Also fixes a name matching error in the iApp's name
This commit is contained in:
parent
f60b8a3abb
commit
2b1f056881
2 changed files with 6 additions and 4 deletions
|
@ -240,10 +240,10 @@ class Parameters(AnsibleF5Parameters):
|
||||||
# There is a bug in the iApp parser in the F5 SDK that prevents us from
|
# There is a bug in the iApp parser in the F5 SDK that prevents us from
|
||||||
# using it in all cases to get the name of an iApp. So we'll use this
|
# using it in all cases to get the name of an iApp. So we'll use this
|
||||||
# pattern for now and file a bug with the F5 SDK
|
# pattern for now and file a bug with the F5 SDK
|
||||||
pattern = r'sys\s+application\s+template\s+(?P<path>\/\w+\/)?(?P<name>[\w.]+)'
|
pattern = r'sys\s+application\s+template\s+(?P<path>\/[^\{}"\'*?|#]+\/)?(?P<name>[^\{}"\'*?|#]+)'
|
||||||
matches = re.search(pattern, self.content)
|
matches = re.search(pattern, self.content)
|
||||||
try:
|
try:
|
||||||
result = matches.group('name')
|
result = matches.group('name').strip()
|
||||||
except IndexError:
|
except IndexError:
|
||||||
result = None
|
result = None
|
||||||
if result:
|
if result:
|
||||||
|
|
|
@ -15,21 +15,23 @@ if sys.version_info < (2, 7):
|
||||||
raise SkipTest("F5 Ansible modules require Python >= 2.7")
|
raise SkipTest("F5 Ansible modules require Python >= 2.7")
|
||||||
|
|
||||||
from ansible.compat.tests import unittest
|
from ansible.compat.tests import unittest
|
||||||
from ansible.compat.tests.mock import patch, Mock
|
from ansible.compat.tests.mock import Mock
|
||||||
|
from ansible.compat.tests.mock import patch
|
||||||
from ansible.module_utils.f5_utils import AnsibleF5Client
|
from ansible.module_utils.f5_utils import AnsibleF5Client
|
||||||
from units.modules.utils import set_module_args
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from library.bigip_iapp_template import Parameters
|
from library.bigip_iapp_template import Parameters
|
||||||
from library.bigip_iapp_template import ModuleManager
|
from library.bigip_iapp_template import ModuleManager
|
||||||
from library.bigip_iapp_template import ArgumentSpec
|
from library.bigip_iapp_template import ArgumentSpec
|
||||||
from ansible.module_utils.f5_utils import iControlUnexpectedHTTPError
|
from ansible.module_utils.f5_utils import iControlUnexpectedHTTPError
|
||||||
|
from test.unit.modules.utils import set_module_args
|
||||||
except ImportError:
|
except ImportError:
|
||||||
try:
|
try:
|
||||||
from ansible.modules.network.f5.bigip_iapp_template import Parameters
|
from ansible.modules.network.f5.bigip_iapp_template import Parameters
|
||||||
from ansible.modules.network.f5.bigip_iapp_template import ArgumentSpec
|
from ansible.modules.network.f5.bigip_iapp_template import ArgumentSpec
|
||||||
from ansible.modules.network.f5.bigip_iapp_template import ModuleManager
|
from ansible.modules.network.f5.bigip_iapp_template import ModuleManager
|
||||||
from ansible.module_utils.f5_utils import iControlUnexpectedHTTPError
|
from ansible.module_utils.f5_utils import iControlUnexpectedHTTPError
|
||||||
|
from units.modules.utils import set_module_args
|
||||||
except ImportError:
|
except ImportError:
|
||||||
raise SkipTest("F5 Ansible modules require the f5-sdk Python library")
|
raise SkipTest("F5 Ansible modules require the f5-sdk Python library")
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue