Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes Private Message Error #129

Merged
merged 4 commits into from Mar 10, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion nautobot_chatops/dispatchers/base.py
Expand Up @@ -7,7 +7,7 @@

from texttable import Texttable

logger = logging.getLogger("rq.worker")
logger = logging.getLogger(__name__)


class Dispatcher:
Expand Down
2 changes: 1 addition & 1 deletion nautobot_chatops/dispatchers/mattermost.py
Expand Up @@ -11,7 +11,7 @@
from nautobot_chatops.metrics import backend_action_sum
from .base import Dispatcher

logger = logging.getLogger("rq.worker")
logger = logging.getLogger(__name__)

# pylint: disable=abstract-method,line-too-long,raise-missing-from

Expand Down
2 changes: 1 addition & 1 deletion nautobot_chatops/dispatchers/ms_teams.py
Expand Up @@ -8,7 +8,7 @@
from nautobot_chatops.metrics import backend_action_sum
from .adaptive_cards import AdaptiveCardsDispatcher

logger = logging.getLogger("rq.worker")
logger = logging.getLogger(__name__)

# Create a metric to track time spent and requests made.
BACKEND_ACTION_LOOKUP = backend_action_sum.labels("msteams", "platform_lookup")
Expand Down
5 changes: 3 additions & 2 deletions nautobot_chatops/dispatchers/slack.py
Expand Up @@ -13,7 +13,7 @@
from nautobot_chatops.metrics import backend_action_sum
from .base import Dispatcher

logger = logging.getLogger("rq.worker")
logger = logging.getLogger(__name__)

# pylint: disable=abstract-method

Expand Down Expand Up @@ -231,7 +231,8 @@ def send_snippet(self, text, title=None, ephemeral=None):
if ephemeral:
message_list = self.split_message(text, SLACK_MAX_MESSAGE_LENGTH)
for msg in message_list:
self.send_blocks(self.markdown_block(f"```\n{msg}\n```"), ephemeral=ephemeral)
# Send the blocks as a list, this needs to be the case for Slack to send appropriately.
self.send_blocks([self.markdown_block(msg)], ephemeral=ephemeral)
jvanderaa marked this conversation as resolved.
Show resolved Hide resolved
else:
self.slack_client.files_upload(channels=channels, content=text, title=title)
except SlackClientError as slack_error:
Expand Down
2 changes: 1 addition & 1 deletion nautobot_chatops/dispatchers/webex.py
Expand Up @@ -10,7 +10,7 @@
from nautobot_chatops.metrics import backend_action_sum
from .adaptive_cards import AdaptiveCardsDispatcher

logger = logging.getLogger("rq.worker")
logger = logging.getLogger(__name__)

# Create a metric to track time spent and requests made.
BACKEND_ACTION_LOOKUP = backend_action_sum.labels("webex", "platform_lookup")
Expand Down
2 changes: 1 addition & 1 deletion nautobot_chatops/workers/__init__.py
Expand Up @@ -18,7 +18,7 @@
from nautobot_chatops.utils import create_command_log
from nautobot_chatops.metrics import request_command_cntr, command_histogram

logger = logging.getLogger("rq.worker")
logger = logging.getLogger(__name__)


_registry_initialized = False # pylint: disable=invalid-name
Expand Down