mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #49497 from rallytime/bp-49473
Back-port #49473 to 2018.3
This commit is contained in:
commit
16ca360d1e
1 changed files with 7 additions and 5 deletions
|
@ -66,13 +66,15 @@ passed in as a dict, or as a string to pull from pillars or minion config:
|
|||
|
||||
# Import Python Libs
|
||||
from __future__ import absolute_import, print_function, unicode_literals
|
||||
import logging
|
||||
import uuid
|
||||
|
||||
# Import Salt Libs
|
||||
import salt.utils.dictupdate as dictupdate
|
||||
from salt.utils import exactly_one
|
||||
from salt.ext.six.moves import range
|
||||
from salt.exceptions import SaltInvocationError
|
||||
import logging
|
||||
import salt.utils.data
|
||||
import salt.utils.dictupdate
|
||||
|
||||
log = logging.getLogger(__name__) # pylint: disable=W1699
|
||||
|
||||
|
||||
|
@ -198,7 +200,7 @@ def hosted_zone_present(name, Name=None, PrivateZone=False,
|
|||
if not isinstance(VPCs, list):
|
||||
raise SaltInvocationError("Parameter 'VPCs' must be a list of dicts.")
|
||||
for v in VPCs:
|
||||
if not isinstance(v, dict) or not exactly_one((v.get('VPCId'), v.get('VPCName'))):
|
||||
if not isinstance(v, dict) or not salt.utils.data.exactly_one((v.get('VPCId'), v.get('VPCName'))):
|
||||
raise SaltInvocationError("Parameter 'VPCs' must be a list of dicts, each composed "
|
||||
"of either a 'VPCId' or a 'VPCName', and optionally a "
|
||||
"'VPCRegion', to help distinguish between multitple matches.")
|
||||
|
@ -306,7 +308,7 @@ def hosted_zone_present(name, Name=None, PrivateZone=False,
|
|||
log.info(msg)
|
||||
ret['comment'] = ' '.join([ret['comment'], msg])
|
||||
ret['changes']['old'] = zone
|
||||
ret['changes']['new'] = dictupdate.update(ret['changes'].get('new', {}), r)
|
||||
ret['changes']['new'] = salt.utils.dictupdate.update(ret['changes'].get('new', {}), r)
|
||||
else:
|
||||
ret['comment'] = 'Update of Route 53 {} hosted zone {} comment failed'.format('private'
|
||||
if PrivateZone else 'public', Name)
|
||||
|
|
Loading…
Add table
Reference in a new issue