Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
Updates Notifier
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Picasoft
Technique
Updates Notifier
Commits
9ef1e44a
Verified
Commit
9ef1e44a
authored
2 years ago
by
Gaëtan Blond
Browse files
Options
Downloads
Patches
Plain Diff
Fixed mattermost posts url
parent
c2a81a46
No related branches found
No related tags found
1 merge request
!1
Refactor and clean old code
Pipeline
#98114
failed
2 years ago
Stage: build
Stage: release
Stage: deploy
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
pyproject.toml
+1
-1
1 addition, 1 deletion
pyproject.toml
updates_notifier/notification_senders/mattermost_notifier.py
+2
-3
2 additions, 3 deletions
updates_notifier/notification_senders/mattermost_notifier.py
with
3 additions
and
4 deletions
pyproject.toml
+
1
−
1
View file @
9ef1e44a
[tool.poetry]
name
=
"updates-notifier"
version
=
"0.1.
1
"
version
=
"0.1.
2
"
description
=
"Notify software updates by using various fetchers and notifiers"
authors
=
[
"Gaëtan Blond <gaetan@blond.tf>"
]
license
=
"MIT"
...
...
This diff is collapsed.
Click to expand it.
updates_notifier/notification_senders/mattermost_notifier.py
+
2
−
3
View file @
9ef1e44a
...
...
@@ -48,13 +48,12 @@ class MattermostNotifier(NotificationSender):
"
channel_id
"
:
self
.
channel_id
,
"
message
"
:
"
\n
"
.
join
(
map
(
MattermostNotifier
.
_entry_to_message
,
entries
)),
}
full_url
=
self
.
_get_api_root
()
+
"
/posts
"
logger
.
debug
(
"
Sending entries to mattermost server %s
"
,
self
.
mattermost_host
)
try
:
response
=
requests
.
post
(
self
.
mattermost_host
,
json
=
req_data
,
headers
=
req_headers
)
response
=
requests
.
post
(
full_url
,
json
=
req_data
,
headers
=
req_headers
)
except
TypeError
as
err
:
raise
NotificationSenderError
(
f
"
Could not serialize entries to Mattermost server
{
self
.
mattermost_host
}
:
{
err
}
"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment