<commit_before>import logging
import time

from ..utils import get_template, get_properties, post_slack_message


class SlackNotification:
    """ Posts slack notification with information about infrastructure changes to prod* accounts """
    def __init__(self, info=None):
        self.info = info
        timestamp = time.strftime("%B %d, %Y %H:%M:%S %Z", time.gmtime())
        self.info['timestamp'] = timestamp
        self.settings = get_properties(self.info['properties'])
        self.info['config_commit_short'] = self.settings['pipeline']['config_commit'][0:11] 

    def post_message(self):
        message = get_template(
                  template_file='slack-templates/pipeline-prepare-ran.j2',
                  info=self.info)
        channel = '#deployments-{}'.format(self.info['env'].lower())
        post_slack_message(message, channel)
        #also posts message to defined slack channel
        if self.settings['pipeline']['notifications']['slack'] != "":
            post_slack_message(message, self.settings['pipeline']['notifications']['slack'])
<commit_msg>bug fix for slack notify not finding channel<commit_after>import logging
import time

from ..utils import get_template, get_properties, post_slack_message


class SlackNotification:
    """ Posts slack notification with information about infrastructure changes to prod* accounts """
    def __init__(self, info=None):
        self.info = info
        timestamp = time.strftime("%B %d, %Y %H:%M:%S %Z", time.gmtime())
        self.info['timestamp'] = timestamp
        self.settings = get_properties(self.info['properties'])
        self.info['config_commit_short'] = self.settings['pipeline']['config_commit'][0:11] 

    def post_message(self):
        message = get_template(
                  template_file='slack-templates/pipeline-prepare-ran.j2',
                  info=self.info)
        channel = '#deployments-{}'.format(self.info['env'].lower())
        post_slack_message(message, channel)
        #also posts message to defined slack channel
        if self.settings['pipeline']['notifications']['slack']:
            post_slack_message(message, self.settings['pipeline']['notifications']['slack'])

{'fraction_non_alphanumeric': 0.13290851160673645, 'fraction_numerical': 0.0036413290851160674, 'mean_word_length': 3.522633744855967, 'pattern_counts': {'":': 1, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1452162', 'n_tokens_mistral': 605, 'n_tokens_neox': 589, 'n_words': 131}