mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Add message to boto_kinesis modules if boto libs are missing
Fixes #43737
This commit is contained in:
parent
41aeee7ac8
commit
5a2593dbd3
2 changed files with 9 additions and 4 deletions
|
@ -66,15 +66,17 @@ except ImportError:
|
|||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
__virtualname__ = 'boto_kinesis'
|
||||
|
||||
|
||||
def __virtual__():
|
||||
'''
|
||||
Only load if boto3 libraries exist.
|
||||
'''
|
||||
if not HAS_BOTO:
|
||||
return False
|
||||
return False, 'The boto_kinesis module could not be loaded: boto libraries not found.'
|
||||
__utils__['boto3.assign_funcs'](__name__, 'kinesis')
|
||||
return True
|
||||
return __virtualname__
|
||||
|
||||
|
||||
def _get_basic_stream(stream_name, conn):
|
||||
|
|
|
@ -63,13 +63,16 @@ import logging
|
|||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
__virtualname__ = 'boto_kinesis'
|
||||
|
||||
|
||||
def __virtual__():
|
||||
'''
|
||||
Only load if boto_kinesis is available.
|
||||
'''
|
||||
ret = 'boto_kinesis' if 'boto_kinesis.exists' in __salt__ else False
|
||||
return ret
|
||||
if 'boto_kinesis.exists' in __salt__:
|
||||
return __virtualname__
|
||||
return False, 'The boto_kinesis module could not be loaded: boto libraries not found.'
|
||||
|
||||
|
||||
def present(name,
|
||||
|
|
Loading…
Add table
Reference in a new issue