Skip to content

Commit

Permalink
Remove redundent code... some more
Browse files Browse the repository at this point in the history
  • Loading branch information
twangboy committed Mar 11, 2020
1 parent 1db3052 commit a7369e4
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions tests/unit/modules/test_win_lgpo.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import salt.config
import salt.loader
import salt.modules.win_lgpo as win_lgpo
import salt.states.win_lgpo
import salt.utils.platform
import salt.utils.stringutils

Expand Down Expand Up @@ -589,19 +590,6 @@ def setUp(self):
win_lgpo.set_(computer_policy=computer_policy)
self.configured = True

def _convert_to_unicode(self, data):
if isinstance(data, six.string_types):
data = data.replace('\x00', '')
return salt.utils.stringutils.to_unicode(data)
elif isinstance(data, dict):
return dict((self._convert_to_unicode(k),
self._convert_to_unicode(v))
for k, v in data.items())
elif isinstance(data, list):
return list(self._convert_to_unicode(v) for v in data)
else:
return data

def _get_policy_adm_setting(self, policy_name, policy_class,
return_full_policy_names, hierarchical_return):
'''
Expand All @@ -621,7 +609,7 @@ def _get_policy_adm_setting(self, policy_name, policy_class,
hierarchical_return=hierarchical_return
)
if six.PY2:
results = self._convert_to_unicode(results)
results = salt.states.win_lgpo._convert_to_unicode(results)
return results
return 'Policy Not Found'

Expand Down

0 comments on commit a7369e4

Please sign in to comment.