Skip to content

Commit 874299c

Browse files
author
pjbreaux
authored
Merge pull request #557 from zancas/bugfix._check_supported_versions_is_method_556
Update _check_supported_versions to be a method.
2 parents b180c4d + 54d42f1 commit 874299c

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

f5/bigip/mixins.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -108,20 +108,22 @@ def __getattr__(container, name):
108108
attribute = lazy_attribute(container)
109109
bases = [base.__name__ for base in lazy_attribute.__bases__]
110110
# Doing version check per each resource
111-
container._check_supported_versions(attribute)
111+
container._check_supported_versions(container, attribute)
112112
if 'Resource' not in bases:
113113
setattr(container, name, attribute)
114114
return attribute
115115

116-
def _check_supported_versions(container, attribute):
116+
def _check_supported_versions(self, container, attribute):
117117
tmos_v = container._meta_data['bigip'].tmos_version
118118
minimum = attribute._meta_data['minimum_version']
119119
if LooseVersion(tmos_v) < LooseVersion(minimum):
120-
error = "There was an attempt to access API which " \
121-
"has not been implemented or supported " \
122-
"in the device's TMOS version: {}. "\
123-
"Minimum TMOS version supported is {}".format(
124-
tmos_v, minimum)
120+
error = "There was an attempt to access resource: \n{}\n which " \
121+
"is not implemented in the device's TMOS version: {}. "\
122+
"The minimum TMOS version in which this resource *is*"\
123+
"supported is {}".format(
124+
attribute._meta_data['uri'],
125+
tmos_v,
126+
minimum)
125127
raise UnsupportedTmosVersion(error)
126128

127129

0 commit comments

Comments
 (0)