Prevent relaunching an ad hoc command if the module is no longer in the allowed list. Fixes https://trello.com/c/NS3YX2DU

This commit is contained in:
Chris Church
2015-05-11 21:05:46 -04:00
parent 2d1d371582
commit 79c00dc511
2 changed files with 23 additions and 0 deletions

View File

@@ -719,6 +719,14 @@ class AdHocCommandApiTest(BaseAdHocCommandTest):
self.patch(url, {}, expect=401)
self.delete(url, expect=401)
# Try to relaunch ad hoc command when module has been removed from
# allowed list of modules.
with self.settings(AD_HOC_COMMANDS=[]):
with self.current_user('admin'):
response = self.get(url, expect=200)
self.assertEqual(response['passwords_needed_to_start'], [])
response = self.post(url, {}, expect=400)
# Try to relaunch after the inventory has been marked inactive.
self.inventory.mark_inactive()
with self.current_user('admin'):