mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 00:55:19 +00:00
Added missing check for arguments in dhcp_options_exists.
This commit is contained in:
parent
b0f11e2e70
commit
02654ce0d4
@ -537,6 +537,9 @@ def dhcp_options_exists(dhcp_options_id=None, name=None, tags=None, region=None,
|
||||
if not conn:
|
||||
return False
|
||||
|
||||
if not dhcp_options_id and not name and not tags:
|
||||
raise SaltInvocationError('At least on of the following must be specified: dhcp options id, name or tags.')
|
||||
|
||||
try:
|
||||
filter_parameters = {'filters': {}}
|
||||
|
||||
|
@ -567,6 +567,11 @@ class BotoVpcDHCPOptionsTestCase(BotoVpcTestCaseBase):
|
||||
|
||||
self.assertFalse(dhcp_options_exists_result)
|
||||
|
||||
@mock_ec2
|
||||
def test_that_when_checking_if_dhcp_options_exists_but_providing_no_filters_the_dhcp_options_exists_method_raises_a_salt_invocation_error(self):
|
||||
with self.assertRaisesRegexp(SaltInvocationError, 'At least on of the following must be specified: subnet id, name or tags.'):
|
||||
boto_vpc.dhcp_options_exists(**conn_parameters)
|
||||
|
||||
|
||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
||||
@skipIf(HAS_BOTO is False, 'The boto module must be installed.')
|
||||
|
Loading…
Reference in New Issue
Block a user