mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 00:55:19 +00:00
Merge pull request #47109 from garethgreenaway/46943_slack_engine_fixes
[2018.3] fixes to Slack engine
This commit is contained in:
commit
a52137ee36
@ -236,16 +236,16 @@ class SlackClient(object):
|
||||
XXX: instead of using Caller, make the minion to use configurable so there could be some
|
||||
restrictions placed on what pillars can be used.
|
||||
'''
|
||||
if pillar_name:
|
||||
caller = salt.client.Caller()
|
||||
pillar_groups = caller.cmd('pillar.get', pillar_name)
|
||||
# pillar_groups = __salt__['pillar.get'](pillar_name, {})
|
||||
log.debug('Got pillar groups %s from pillar %s', pillar_groups, pillar_name)
|
||||
log.debug('pillar groups is %s', pillar_groups)
|
||||
log.debug('pillar groups type is %s', type(pillar_groups))
|
||||
if pillar_groups:
|
||||
return pillar_groups
|
||||
else:
|
||||
return {}
|
||||
pillar_groups = {}
|
||||
return pillar_groups
|
||||
|
||||
def fire(self, tag, msg):
|
||||
'''
|
||||
@ -416,6 +416,11 @@ class SlackClient(object):
|
||||
'so we look for user in '
|
||||
'the original message.')
|
||||
user_id = m_data['message']['user']
|
||||
elif 'comment' in m_data and 'user' in m_data['comment']:
|
||||
log.debug('Comment was added, '
|
||||
'so we look for user in '
|
||||
'the comment.')
|
||||
user_id = m_data['comment']['user']
|
||||
else:
|
||||
user_id = m_data.get('user')
|
||||
channel_id = m_data.get('channel')
|
||||
|
Loading…
Reference in New Issue
Block a user