Skip to content

Commit 5db1b31

Browse files
Merge pull request #1565 from zhaoqin-github/v3.0.11-dev
Create v3.0.11.1 release and include BWC policy support
2 parents e3d2dc8 + ad9e0d5 commit 5db1b31

File tree

21 files changed

+299
-127
lines changed

21 files changed

+299
-127
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ script:
3131
- sudo chown travis:travis ${DIST_REPO}/deb_dist/*.deb
3232
after_success:
3333
- md5sum ${PKG_RELEASE_EL7} > ${PKG_RELEASE_EL7}.md5 && md5sum --check ${PKG_RELEASE_EL7}.md5
34-
- md5sum ${PKG_RELEASE_1404} > ${PKG_RELEASE_1404}.md5 && md5sum --check ${PKG_RELASE_1404}.md5
34+
- md5sum ${PKG_RELEASE_1404} > ${PKG_RELEASE_1404}.md5 && md5sum --check ${PKG_RELEASE_1404}.md5
3535

3636
before_deploy: PKG_VERSION=$(python -c "import f5; print(f5.__version__)")
3737
deploy:

f5-sdk-dist/scripts/construct_setups.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@
2626

2727
from collections import deque
2828
from collections import namedtuple
29-
from pip.req import parse_requirements as p_reqs
29+
30+
try: # for pip >= 10
31+
from pip._internal.req import parse_requirements as p_reqs
32+
except ImportError: # for pip <= 9.0.3
33+
from pip.req import parse_requirements as p_reqs
3034

3135

3236
def construct_cfgs(**kargs):

f5/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414
#
15-
__version__ = '3.0.11'
15+
__version__ = '3.0.11.1'

f5/bigip/mixins.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ class AsmFileMixin(object):
369369
370370
"""
371371
def _download_file(self, filepathname):
372-
self._download(filepathname)
372+
self._download(filepathname)
373373

374374
def _download(self, filepathname):
375375
session = self._meta_data['icr_session']

f5/bigip/resource.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -288,10 +288,10 @@ def _check_generation(self):
288288
response = session.get(self._meta_data['uri'])
289289
current_gen = response.json().get('generation', None)
290290
if current_gen is not None and current_gen != self.generation:
291-
error_message = ("The generation of the object on the BigIP " +
292-
"(" + str(current_gen) + ")" +
293-
" does not match the current object" +
294-
"(" + str(self.generation) + ")")
291+
error_message = ("The generation of the object on the BigIP "
292+
+ "(" + str(current_gen) + ")"
293+
+ " does not match the current object"
294+
+ "(" + str(self.generation) + ")")
295295
raise GenerationMismatch(error_message)
296296

297297
def _handle_requests_params(self, kwargs):
@@ -974,7 +974,7 @@ def _create(self, **kwargs):
974974
return result
975975

976976
def create(self, **kwargs):
977-
"""Create the resource on the BIG-IP®.
977+
r"""Create the resource on the BIG-IP®.
978978
979979
Uses HTTP POST to the `collection` URI to create a resource associated
980980
with a new unique URI on the device.
@@ -1041,7 +1041,7 @@ def _load(self, **kwargs):
10411041
return self._produce_instance(response)
10421042

10431043
def load(self, **kwargs):
1044-
"""Load an already configured service into this instance.
1044+
r"""Load an already configured service into this instance.
10451045
10461046
This method uses HTTP GET to obtain a resource from the BIG-IP®.
10471047
@@ -1081,7 +1081,7 @@ def _delete(self, **kwargs):
10811081
self.__dict__ = {'deleted': True}
10821082

10831083
def delete(self, **kwargs):
1084-
"""Delete the resource on the BIG-IP®.
1084+
r"""Delete the resource on the BIG-IP®.
10851085
10861086
Uses HTTP DELETE to delete the resource on the BIG-IP®.
10871087
@@ -1103,7 +1103,7 @@ def delete(self, **kwargs):
11031103
# Need to implement correct teardown here.
11041104

11051105
def exists(self, **kwargs):
1106-
"""Check for the existence of the named object on the BIG-IP
1106+
r"""Check for the existence of the named object on the BIG-IP
11071107
11081108
Sends an HTTP GET to the URI of the named object and if it fails with
11091109
a :exc:~requests.HTTPError` exception it checks the exception for
@@ -1252,7 +1252,7 @@ def _load(self, **kwargs):
12521252
return self._produce_instance(response)
12531253

12541254
def load(self, **kwargs):
1255-
"""Load an already configured service into this instance.
1255+
r"""Load an already configured service into this instance.
12561256
12571257
This method uses HTTP GET to obtain a resource from the BIG-IP®.
12581258
@@ -1303,7 +1303,7 @@ def delete(self, **kwargs):
13031303
# Need to implement correct teardown here.
13041304

13051305
def exists(self, **kwargs):
1306-
"""Check for the existence of the ASM object on the BIG-IP
1306+
r"""Check for the existence of the ASM object on the BIG-IP
13071307
13081308
Sends an HTTP GET to the URI of the ASM object and if it fails with
13091309
a :exc:~requests.HTTPError` exception it checks the exception for
@@ -1504,7 +1504,7 @@ def delete(self, **kwargs):
15041504
# Need to implement correct teardown here.
15051505

15061506
def exists(self, **kwargs):
1507-
"""Check for the existence of the Task object on the BIG-IP
1507+
r"""Check for the existence of the Task object on the BIG-IP
15081508
15091509
Sends an HTTP GET to the URI of the ASM object and if it fails with
15101510
a :exc:~requests.HTTPError` exception it checks the exception for

f5/bigip/test/unit/test_mixins.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,10 +174,10 @@ def fake_http_server(uri, **kwargs):
174174

175175

176176
class FakeAsmFileMixin(AsmFileMixin):
177-
def __init__(self, uri, **kwargs):
178-
session = fake_http_server(uri, **kwargs)
179-
self._meta_data = {'icr_session': session}
180-
self.file_bound_uri = uri
177+
def __init__(self, uri, **kwargs):
178+
session = fake_http_server(uri, **kwargs)
179+
self._meta_data = {'icr_session': session}
180+
self.file_bound_uri = uri
181181

182182

183183
class TestAsmFileMixin(object):

f5/bigip/tm/gtm/test/functional/test_server.py

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -176,9 +176,10 @@ def test_load_no_object(self, mgmt_root):
176176
name='fake_serv1')
177177
assert err.value.response.status_code == 404
178178

179-
@pytest.mark.skipif(LooseVersion(pytest.config.getoption('--release')) ==
180-
'11.5.4',
181-
reason='Needs > v11.5.4 TMOS to pass')
179+
@pytest.mark.skipif(
180+
LooseVersion(pytest.config.getoption('--release')) == '11.5.4',
181+
reason='Needs > v11.5.4 TMOS to pass'
182+
)
182183
def test_load(self, request, mgmt_root):
183184
setup_basic_test(request, mgmt_root, 'fake_serv1', 'Common')
184185
s1 = mgmt_root.tm.gtm.servers.server.load(name='fake_serv1')
@@ -192,9 +193,9 @@ def test_load(self, request, mgmt_root):
192193
assert s2.disabled is True
193194

194195
@pytest.mark.skipif(
195-
LooseVersion(pytest.config.getoption('--release')) >= LooseVersion(
196-
'11.6.0'),
197-
reason='This test is for 11.5.4 or less.')
196+
LooseVersion(pytest.config.getoption('--release')) >= LooseVersion('11.6.0'),
197+
reason='This test is for 11.5.4 or less.'
198+
)
198199
def test_load_11_5_4_and_less(self, request, mgmt_root):
199200
setup_basic_test(request, mgmt_root, 'fake_serv1', 'Common')
200201
s1 = mgmt_root.tm.gtm.servers.server.load(name='fake_serv1')
@@ -237,8 +238,7 @@ def test_delete(self, request, mgmt_root):
237238
class TestServerCollection(object):
238239
def test_server_collection(self, request, mgmt_root):
239240
s1 = setup_basic_test(request, mgmt_root, 'fake_serv1', 'Common')
240-
if LooseVersion(pytest.config.getoption('--release')) >= \
241-
LooseVersion('12.1.0'):
241+
if LooseVersion(pytest.config.getoption('--release')) >= LooseVersion('12.1.0'):
242242
link = 'https://localhost/mgmt/tm/gtm/server/~Common~fake_serv1'
243243
else:
244244
link = 'https://localhost/mgmt/tm/gtm/server/fake_serv1'
@@ -259,8 +259,7 @@ def test_create_req_arg(self, request, mgmt_root):
259259
s1 = setup_basic_test(request, mgmt_root, 'fake_serv1', 'Common')
260260
vs = s1.virtual_servers_s
261261
vs1 = vs.virtual_server.create(name='vs1', destination='5.5.5.5:80')
262-
if LooseVersion(pytest.config.getoption('--release')) >= \
263-
LooseVersion('12.1.0'):
262+
if LooseVersion(pytest.config.getoption('--release')) >= LooseVersion('12.1.0'):
264263
link = 'https://localhost/mgmt/tm/gtm/server/~Common~fake_serv1' \
265264
'/virtual-servers/vs'
266265
else:
@@ -347,9 +346,10 @@ def test_modify(self, request, mgmt_root):
347346
elif k == limit:
348347
assert vs1.__dict__[k] == 'enabled'
349348

350-
@pytest.mark.skipif(pytest.config.getoption('--release') == '11.6.0',
351-
reason='Due to a bug in 11.6.0 Final this test '
352-
'fails')
349+
@pytest.mark.skipif(
350+
pytest.config.getoption('--release') == '11.6.0',
351+
reason='Due to a bug in 11.6.0 Final this test fails'
352+
)
353353
def test_delete(self, request, mgmt_root):
354354
vs1 = setup_vs_basic_test(request, mgmt_root, 'vs2', '5.5.5.5:80')
355355
vs1.delete()
@@ -361,8 +361,7 @@ def test_delete(self, request, mgmt_root):
361361

362362
def test_virtual_server_collection(self, request, mgmt_root):
363363
vs1 = setup_vs_basic_test(request, mgmt_root, 'vs1', '5.5.5.5:80')
364-
if LooseVersion(pytest.config.getoption('--release')) >= \
365-
LooseVersion('12.1.0'):
364+
if LooseVersion(pytest.config.getoption('--release')) >= LooseVersion('12.1.0'):
366365
link = 'https://localhost/mgmt/tm/gtm/server/~Common~fake_serv1' \
367366
'/virtual-servers/vs'
368367
else:

f5/bigip/tm/gtm/test/functional/test_topology.py

Lines changed: 50 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
from pytest import symbols
2525
from requests.exceptions import HTTPError
2626

27+
RELEASE_LOOSE_VERSION = LooseVersion(pytest.config.getoption('--release'))
28+
2729
pytestmark = pytest.mark.skipif(
2830
symbols
2931
and hasattr(symbols, 'modules')
@@ -64,10 +66,10 @@ def teardown():
6466
return top1
6567

6668

67-
@pytest.mark.skipif(LooseVersion(pytest.config.getoption('--release')) <
68-
'12.1.0' or
69-
LooseVersion(pytest.config.getoption('--release')) ==
70-
'12.0.0', reason='Needs > v12.1.0 TMOS to pass')
69+
@pytest.mark.skipif(
70+
RELEASE_LOOSE_VERSION < '12.1.0' or RELEASE_LOOSE_VERSION == '12.0.0',
71+
reason='Needs > v12.1.0 TMOS to pass'
72+
)
7173
class TestCreate(object):
7274
def test_create_no_args(self, mgmt_root):
7375
with pytest.raises(MissingRequiredCreationParameter):
@@ -105,10 +107,10 @@ def test_create_duplicate(self, request, mgmt_root):
105107
assert err.value.response.status_code == 409
106108

107109

108-
@pytest.mark.skipif(LooseVersion(pytest.config.getoption('--release')) >=
109-
'12.1.0' or
110-
LooseVersion(pytest.config.getoption('--release')) ==
111-
'12.0.0', reason='Needs < v12.1.0 TMOS to pass')
110+
@pytest.mark.skipif(
111+
RELEASE_LOOSE_VERSION >= '12.1.0' or RELEASE_LOOSE_VERSION == '12.0.0',
112+
reason='Needs < v12.1.0 TMOS to pass'
113+
)
112114
class TestCreate_pre_12_1_0(object):
113115
def test_create_no_args(self, mgmt_root):
114116
with pytest.raises(MissingRequiredCreationParameter):
@@ -146,18 +148,20 @@ def test_create_duplicate(self, request, mgmt_root):
146148
assert err.value.response.status_code == 409
147149

148150

149-
@pytest.mark.skipif(LooseVersion(pytest.config.getoption('--release')) ==
150-
'12.0.0', reason='Resource disabled for TMOS 12.0.0')
151+
@pytest.mark.skipif(
152+
RELEASE_LOOSE_VERSION == '12.0.0',
153+
reason='Resource disabled for TMOS 12.0.0'
154+
)
151155
class TestRefresh(object):
152156
def test_refresh_raises(self, mgmt_root):
153157
with pytest.raises(UnsupportedOperation):
154158
mgmt_root.tm.gtm.topology_s.topology.refresh()
155159

156160

157-
@pytest.mark.skipif(LooseVersion(pytest.config.getoption('--release')) <
158-
'12.1.0' or
159-
LooseVersion(pytest.config.getoption('--release')) ==
160-
'12.0.0', reason='Needs > v12.1.0 TMOS to pass')
161+
@pytest.mark.skipif(
162+
RELEASE_LOOSE_VERSION < '12.1.0' or RELEASE_LOOSE_VERSION == '12.0.0',
163+
reason='Needs > v12.1.0 TMOS to pass'
164+
)
161165
class TestLoad(object):
162166
def test_load_no_object(self, mgmt_root):
163167
with pytest.raises(HTTPError) as err:
@@ -174,10 +178,10 @@ def test_load(self, request, mgmt_root):
174178
assert t1.selfLink == t2.selfLink
175179

176180

177-
@pytest.mark.skipif(LooseVersion(pytest.config.getoption('--release')) >=
178-
'12.1.0' or
179-
LooseVersion(pytest.config.getoption('--release')) ==
180-
'12.0.0', reason='Needs < v12.1.0 TMOS to pass')
181+
@pytest.mark.skipif(
182+
RELEASE_LOOSE_VERSION >= '12.1.0' or RELEASE_LOOSE_VERSION == '12.0.0',
183+
reason='Needs < v12.1.0 TMOS to pass'
184+
)
181185
class TestLoad_pre_12_1_0(object):
182186
def test_load_no_object(self, mgmt_root):
183187
with pytest.raises(HTTPError) as err:
@@ -194,24 +198,30 @@ def test_load(self, request, mgmt_root):
194198
assert t1.selfLink == t2.selfLink
195199

196200

197-
@pytest.mark.skipif(LooseVersion(pytest.config.getoption('--release')) ==
198-
'12.0.0', reason='Resource disabled for TMOS 12.0.0')
201+
@pytest.mark.skipif(
202+
RELEASE_LOOSE_VERSION == '12.0.0',
203+
reason='Resource disabled for TMOS 12.0.0'
204+
)
199205
class TestUpdate(object):
200206
def test_update_raises(self, mgmt_root):
201207
with pytest.raises(UnsupportedOperation):
202208
mgmt_root.tm.gtm.topology_s.topology.update()
203209

204210

205-
@pytest.mark.skipif(LooseVersion(pytest.config.getoption('--release')) ==
206-
'12.0.0', reason='Resource disabled for TMOS 12.0.0')
211+
@pytest.mark.skipif(
212+
RELEASE_LOOSE_VERSION == '12.0.0',
213+
reason='Resource disabled for TMOS 12.0.0'
214+
)
207215
class TestModify(object):
208216
def test_modify_raises(self, mgmt_root):
209217
with pytest.raises(UnsupportedOperation):
210218
mgmt_root.tm.gtm.topology_s.topology.modify()
211219

212220

213-
@pytest.mark.skipif(LooseVersion(pytest.config.getoption('--release')) <
214-
'12.1.0', reason='Needs > v12.1.0 TMOS to pass')
221+
@pytest.mark.skipif(
222+
RELEASE_LOOSE_VERSION < '12.1.0',
223+
reason='Needs > v12.1.0 TMOS to pass'
224+
)
215225
class TestDelete(object):
216226
def test_delete(self, request, mgmt_root):
217227
r1 = setup_basic_test(request, mgmt_root, NAME)
@@ -221,10 +231,10 @@ def test_delete(self, request, mgmt_root):
221231
assert err.value.response.status_code == 404
222232

223233

224-
@pytest.mark.skipif(LooseVersion(pytest.config.getoption('--release')) >=
225-
'12.1.0' or
226-
LooseVersion(pytest.config.getoption('--release')) ==
227-
'12.0.0', reason='Needs < v12.1.0 TMOS to pass')
234+
@pytest.mark.skipif(
235+
RELEASE_LOOSE_VERSION >= '12.1.0' or RELEASE_LOOSE_VERSION == '12.0.0',
236+
reason='Needs < v12.1.0 TMOS to pass'
237+
)
228238
class TestDelete_pre_12_1_0(object):
229239
def test_delete(self, request, mgmt_root):
230240
r1 = setup_basic_test(request, mgmt_root, NAME_SPACES)
@@ -234,10 +244,10 @@ def test_delete(self, request, mgmt_root):
234244
assert err.value.response.status_code == 404
235245

236246

237-
@pytest.mark.skipif(LooseVersion(pytest.config.getoption('--release')) <
238-
'12.1.0' or
239-
LooseVersion(pytest.config.getoption('--release')) ==
240-
'12.0.0', reason='Needs > v12.1.0 TMOS to pass')
247+
@pytest.mark.skipif(
248+
RELEASE_LOOSE_VERSION < '12.1.0' or RELEASE_LOOSE_VERSION == '12.0.0',
249+
reason='Needs > v12.1.0 TMOS to pass'
250+
)
241251
class TestTopologyCollection(object):
242252
def test_region_collection(self, request, mgmt_root):
243253
setup_create_test(request, mgmt_root, NAME)
@@ -257,10 +267,10 @@ def test_region_collection(self, request, mgmt_root):
257267
assert isinstance(rc[0], Topology)
258268

259269

260-
@pytest.mark.skipif(LooseVersion(pytest.config.getoption('--release')) >=
261-
'12.1.0' or
262-
LooseVersion(pytest.config.getoption('--release')) ==
263-
'12.0.0', reason='Needs < v12.1.0 TMOS to pass')
270+
@pytest.mark.skipif(
271+
RELEASE_LOOSE_VERSION >= '12.1.0' or RELEASE_LOOSE_VERSION == '12.0.0',
272+
reason='Needs < v12.1.0 TMOS to pass'
273+
)
264274
class TestTopologyCollection_pre_12_1_0(object):
265275
def test_region_collection(self, request, mgmt_root):
266276
setup_create_test(request, mgmt_root, NAME_SPACES)
@@ -280,8 +290,10 @@ def test_region_collection(self, request, mgmt_root):
280290
assert isinstance(rc[0], Topology)
281291

282292

283-
@pytest.mark.skipif(LooseVersion(pytest.config.getoption('--release')) !=
284-
'12.0.0', reason='Only TMOS 12.0.0 test')
293+
@pytest.mark.skipif(
294+
RELEASE_LOOSE_VERSION != '12.0.0',
295+
reason='Only TMOS 12.0.0 test'
296+
)
285297
class TestTopology_12_0_0(object):
286298
def test_topology_raises(self, request, mgmt_root):
287299
with pytest.raises(UnsupportedTmosVersion):

f5/bigip/tm/gtm/test/unit/test_pool.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ def test_non_404_response__v12_1(self, fakeicontrolsession_v12):
285285
session.post.side_effect = error
286286
memres._meta_data['bigip']._meta_data['icr_session'] = session
287287
with pytest.raises(HTTPError) as err:
288-
memres.create(name='fake', partition='fakepart')
288+
memres.create(name='fake', partition='fakepart')
289289
assert err.value.response.status_code == 500
290290

291291
def test_404_response_v12_1(self, fakeicontrolsession_v12):

f5/bigip/tm/ltm/test/functional/test_pool.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def test_get_collection(self, request, mgmt_root, opt_release):
7979
member1.refresh()
8080
except HTTPError as err:
8181
if err.response.status_code != 404:
82-
raise
82+
raise
8383
pre_del = set(iterkeys(pool1.__dict__))
8484
pool1.refresh()
8585
post_del = set(iterkeys(pool1.__dict__))

0 commit comments

Comments
 (0)