Skip to content

Commit 7d34454

Browse files
authored
Merge pull request #581 from pjbreaux/bugfix.services_12_1_0
During functional testing against 12.1.0, sys/application test fails and errors out
2 parents a80450e + 26ec45d commit 7d34454

2 files changed

Lines changed: 13 additions & 4 deletions

File tree

f5/bigip/tm/sys/application.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def _create(self, **kwargs):
111111
'''
112112

113113
try:
114-
super(Service, self)._create(**kwargs)
114+
return super(Service, self)._create(**kwargs)
115115
except HTTPError as ex:
116116
if "The configuration was updated successfully but could not be " \
117117
"retrieved" not in ex.response.text:

test/functional/tm/sys/test_sys_application.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,14 @@
1313
# limitations under the License.
1414
#
1515

16-
from pprint import pprint as pp
1716
from requests import HTTPError
1817

19-
pp(__file__)
18+
from f5.bigip.tm.sys.application import Service
19+
from f5.bigip.tm.sys.application import Template
20+
2021
TESTDESCRIPTION = 'TESTDESCRIPTION'
2122

22-
# Application Service Dictionary
23+
# Application service dictionary, which matches JSON structure
2324
sections = {
2425
'implementation': '',
2526
'presentation': ''
@@ -53,19 +54,23 @@ def setup_template_test(request, bigip, name, partition):
5354

5455
def teardown():
5556
delete_resource(test_template)
57+
5658
request.addfinalizer(teardown)
5759
test_template = template_s.template.create(
5860
name=name,
5961
partition=partition,
6062
actions=definition
6163
)
64+
assert isinstance(test_template, Template)
65+
assert id(test_template) != id(template_s.template)
6266
return template_s, test_template
6367

6468

6569
def setup_service_test(request, bigip, name, partition, template_name, tgroup):
6670
service_s = setup_service_collection_test(request, bigip)
6771

6872
def teardown():
73+
# Delete the service first, then the template
6974
delete_resource(test_service)
7075
delete_resource(test_template)
7176

@@ -75,12 +80,16 @@ def teardown():
7580
partition=partition,
7681
actions=definition
7782
)
83+
assert isinstance(test_template, Template)
84+
assert id(test_template) != id(template_factory)
7885
test_service = service_s.service.create(
7986
name=name,
8087
partition=partition,
8188
template=template_name,
8289
trafficGroup=tgroup
8390
)
91+
assert isinstance(test_service, Service)
92+
assert id(test_service) != id(service_s.service)
8493
request.addfinalizer(teardown)
8594
return service_s, test_service
8695

0 commit comments

Comments
 (0)