File tree Expand file tree Collapse file tree 4 files changed +35
-0
lines changed Expand file tree Collapse file tree 4 files changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,16 @@ def __init__(self, edge):
15
15
super ().__init__ (edge )
16
16
self .regen = Regeneration (self ._edge )
17
17
18
+ def is_enabled (self ):
19
+ """
20
+ Check if deduplication is enabled
21
+
22
+ :return: True is deduplication is enabled, else False
23
+ :rtype: bool
24
+ """
25
+ response = self ._edge .api .get ('/config/dedup/useLocalMapFileDedup' )
26
+ return False if response is None else response
27
+
18
28
def enable (self , reboot = False , wait = False ):
19
29
"""
20
30
Enable local deduplication
Original file line number Diff line number Diff line change @@ -170,6 +170,14 @@ Volume Management
170
170
Deduplication
171
171
-------------
172
172
173
+ .. automethod :: cterasdk.edge.dedup.Dedup.is_enabled
174
+ :noindex:
175
+
176
+ .. code-block :: python
177
+
178
+ """ Check if deduplication is enabled"""
179
+ edge.dedup.is_enabled()
180
+
173
181
.. automethod :: cterasdk.edge.dedup.Dedup.enable
174
182
:noindex:
175
183
Original file line number Diff line number Diff line change 1
1
Changelog
2
2
=========
3
3
4
+ 2.20.17
5
+ -------
6
+
7
+ Improvements
8
+ ^^^^^^^^^^^^
9
+
10
+ * Added support to validate if deduplication is enabled on the CTERA Edge Filer
11
+
12
+ Related issues and pull requests on GitHub: `#313 <https://github.com/ctera/ctera-python-sdk/pull/313 >`_,
13
+
4
14
2.20.16
5
15
-------
6
16
Original file line number Diff line number Diff line change @@ -13,6 +13,13 @@ def setUp(self):
13
13
super ().setUp ()
14
14
self ._mock_reboot = self .patch_call ('cterasdk.edge.power.Power.reboot' )
15
15
16
+ def test_is_enabled (self ):
17
+ get_response = True
18
+ self ._init_filer (get_response = get_response )
19
+ ret = dedup .Dedup (self ._filer ).is_enabled ()
20
+ self ._filer .api .get .assert_called_once_with ('/config/dedup/useLocalMapFileDedup' )
21
+ self .assertEqual (ret , True )
22
+
16
23
def test_enable_reboot_wait (self ):
17
24
put_response = 'Success'
18
25
self ._init_filer (put_response = put_response )
You can’t perform that action at this time.
0 commit comments