Skip to content

Commit c89bafb

Browse files
authored
Makes PATCH allowed for a sys data group file (#1389)
Issues: Fixes #1388 Problem: PATCHing was not allowed for data groups in sys/file Analysis: This fixes the SDK to allow it. Tests: functional
1 parent c569d1c commit c89bafb

4 files changed

Lines changed: 5 additions & 16 deletions

File tree

f5/bigip/shared/test/unit/test_file_uploads.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ def test_file_upload_70a(tmpdir, fakeicontrolsession):
4848
ftu.upload_file(filepath.__str__(), chunk_size=20)
4949
session_mock = mr._meta_data['icr_session']
5050
for i in range(3):
51-
print(i)
5251
d = session_mock.post.call_args_list[i][1]['data']
5352
assert d == b'aaaaaaaaaaaaaaaaaaaa'
5453
lchunk = session_mock.post.call_args_list[3][1]['data']

f5/bigip/tm/sys/file.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,6 @@ def __init__(self, data_groups):
6464
self._meta_data['required_creation_parameters'].update(
6565
('name', 'sourcePath', 'type'))
6666

67-
def modify(self, **kwargs):
68-
'''Modify is not supported for iFiles
69-
70-
:raises: UnsupportedOperation
71-
'''
72-
raise UnsupportedMethod(
73-
"%s does not support the update method" % self.__class__.__name__)
74-
7567
def update(self, **kwargs):
7668
if LooseVersion(self._meta_data['bigip']._meta_data['tmos_version']) \
7769
< LooseVersion('12.0.0'):

f5/bigip/tm/sys/test/functional/test_file.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,7 @@ def test_CURDL_datagroup(request, mgmt_root):
9595
# Upload the file
9696
mgmt_root.shared.file_transfer.uploads.upload_file(ntf.name)
9797
tpath_name = 'file:/var/config/rest/downloads/{0}'.format(ntf_basename)
98-
dg1 = setup_datagroup_test(request, mgmt_root, ntf_basename, tpath_name,
99-
)
98+
dg1 = setup_datagroup_test(request, mgmt_root, ntf_basename, tpath_name)
10099
assert dg1.name == ntf_basename
101100

102101
# Load Object
@@ -116,6 +115,10 @@ def test_CURDL_datagroup(request, mgmt_root):
116115
dg2.refresh()
117116
assert dg2.revision == dg3.revision
118117

118+
dg4 = mgmt_root.tm.sys.file.data_groups.data_group.load(name=ntf_basename)
119+
dg4.modify(sourcePath=tpath_name)
120+
assert dg1.revision != dg4.revision
121+
119122

120123
def setup_ifile_test(request, mgmt_root, name, sourcepath, **kwargs):
121124
if1 = mgmt_root.tm.sys.file.ifiles.ifile.create(name=name,

f5/bigip/tm/sys/test/unit/test_file.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,6 @@ def test_dg_create_missing_arg(FakeSysDatagroup):
4545
assert 'type' in ex.value.message
4646

4747

48-
def test_dg_modify(FakeSysDatagroup):
49-
with pytest.raises(UnsupportedMethod):
50-
FakeSysDatagroup.modify(value='Fake')
51-
52-
5348
@pytest.fixture
5449
def FakeSysIfile():
5550
fake_ifile_s = mock.MagicMock()

0 commit comments

Comments
 (0)