Skip to content

Commit 0ffbf1e

Browse files
authored
Ronerez/edge mapping (#311)
1 parent 2b429ad commit 0ffbf1e

4 files changed

Lines changed: 10 additions & 6 deletions

File tree

cterasdk/edge/directoryservice.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ def set_advanced_mapping(self, mappings):
108108
raise CTERAException('Failed to configure advanced mapping. Not connected to directory services.')
109109

110110
domains = self.domains()
111-
advanced_mapping = self._edge.api.get('/config/fileservices/cifs/idMapping/map')
112111
advanced_mapping = []
113112
for mapping in mappings:
114113
if mapping.domainFlatName in domains:

docs/source/UserGuides/Edge/Configuration.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,8 @@ Active Directory
449449
450450
edge.directoryservice.set_advanced_mapping(advanced_mapping) # this function will skip domains that are not found
451451
452+
.. note:: This method sets the advanced mapping of domains and requires the full list of mappings.
453+
It does not append to the existing configuration—any existing mappings will be overwritten.
452454
.. note:: to retrieve a list of domain flat names, use :py:func:`cterasdk.edge.directoryservice.domains()`
453455

454456
.. automethod:: cterasdk.edge.directoryservice.DirectoryService.disconnect

docs/source/UserGuides/Miscellaneous/Changelog.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,13 @@ Improvements
99

1010
* Added support for enabling or disabling Direct Mode on CTERA Portal Storage Nodes.
1111

12-
Related issues and pull requests on GitHub: `#310 <https://github.com/ctera/ctera-python-sdk/pull/310>`_
12+
Bug Fixes
13+
^^^^^^^^^
14+
15+
* Removed redundant call when retrieving the list of domain mappings.
16+
17+
Related issues and pull requests on GitHub: `#310 <https://github.com/ctera/ctera-python-sdk/pull/310>`_,
18+
`#311 <https://github.com/ctera/ctera-python-sdk/pull/311>`_
1319

1420
2.20.15
1521
-------

tests/ut/edge/test_directory_service.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,10 +146,7 @@ def test_set_advanced_mapping(self):
146146
]
147147
self._init_filer(get_response=0, execute_response=execute_response)
148148
directoryservice.DirectoryService(self._filer).set_advanced_mapping(advanced_mapping)
149-
self._filer.api.get.assert_has_calls([
150-
mock.call('/status/fileservices/cifs/joinStatus'),
151-
mock.call('/config/fileservices/cifs/idMapping/map')
152-
])
149+
self._filer.api.get.assert_called_once_with('/status/fileservices/cifs/joinStatus')
153150
self._filer.api.execute.assert_called_once_with('/status/fileservices/cifs', 'enumDiscoveredDomains')
154151
self._filer.api.put.assert_called_once_with('/config/fileservices/cifs/idMapping/map', mock.ANY)
155152
actual_param = self._filer.api.put.call_args[0][1]

0 commit comments

Comments
 (0)