move the disable call up in try block

This commit is contained in:
Ch3LL 2018-07-19 10:32:21 -04:00
parent f60d21bda4
commit f1fbfad387
No known key found for this signature in database
GPG key ID: 132B55A7C13EFA73

View file

@ -129,9 +129,9 @@ class ServiceModuleTest(ModuleCase):
self.assertTrue(self.run_function('service.disable', [srv_name]))
else:
try:
disable = self.run_function('service.disable', [srv_name])
self.assertFalse(disable)
except AssertionError:
disable = self.run_function('service.disable', [srv_name])
self.assertTrue('error' in disable.lower())
if salt.utils.is_darwin():