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):
1515 super ().__init__ (edge )
1616 self .regen = Regeneration (self ._edge )
1717
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+
1828 def enable (self , reboot = False , wait = False ):
1929 """
2030 Enable local deduplication
Original file line number Diff line number Diff line change @@ -170,6 +170,14 @@ Volume Management
170170 Deduplication
171171-------------
172172
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+
173181 .. automethod :: cterasdk.edge.dedup.Dedup.enable
174182 :noindex:
175183
Original file line number Diff line number Diff line change 11Changelog
22=========
33
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+
4142.20.16
515-------
616
Original file line number Diff line number Diff line change @@ -13,6 +13,13 @@ def setUp(self):
1313 super ().setUp ()
1414 self ._mock_reboot = self .patch_call ('cterasdk.edge.power.Power.reboot' )
1515
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+
1623 def test_enable_reboot_wait (self ):
1724 put_response = 'Success'
1825 self ._init_filer (put_response = put_response )
You can’t perform that action at this time.
0 commit comments