Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
rabbitmq_agents
Manage
Activity
Members
Labels
Plan
Issues
13
Issue boards
Milestones
Wiki
Code
Merge requests
8
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
rc
rabbitmq_agents
Commits
d21afd8d
Unverified
Commit
d21afd8d
authored
4 years ago
by
Ravi Tripathi
Committed by
GitHub
4 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #74 from rtripath89/feat-correct_taskmgr_var
Feat correct taskmgr var
parents
beaa5627
1bdf5a0c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
3 merge requests
!147
Merge previous default branch feat-cod-rmq into main
,
!85
kill nginx process running under user from login node
,
!78
Feat cod rmq
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
mail_config.py.example
+0
-0
0 additions, 0 deletions
mail_config.py.example
task_manager.py
+7
-6
7 additions, 6 deletions
task_manager.py
with
7 additions
and
6 deletions
mail_config.py
→
mail_config.py
.example
+
0
−
0
View file @
d21afd8d
File moved
This diff is collapsed.
Click to expand it.
task_manager.py
+
7
−
6
View file @
d21afd8d
...
...
@@ -10,6 +10,7 @@ from rc_rmq import RCRMQ
from
jinja2
import
Template
from
datetime
import
datetime
import
mail_config
as
mail_cfg
import
rabbitmq_config
as
rcfg
task
=
'
task_manager
'
timeout
=
30
...
...
@@ -50,7 +51,7 @@ tracking = {}
rc_rmq
=
RCRMQ
({
'
exchange
'
:
'
RegUsr
'
,
'
exchange_type
'
:
'
topic
'
})
def
notify_admin
(
username
,
user_record
):
receivers
=
[
user_record
[
'
email
'
],
mail_
cfg
.
Admin_email
]
receivers
=
[
user_record
[
'
email
'
],
r
cfg
.
Admin_email
]
message
=
Template
(
mail_cfg
.
UserReportHead
).
render
(
username
=
username
,
fullname
=
user_record
[
'
fullname
'
])
if
user_record
[
'
reported
'
]:
message
+=
'
(Duplicate)
'
...
...
@@ -73,15 +74,15 @@ def notify_admin(username, user_record):
message
+=
msg
+
"
\n
"
if
args
.
dry_run
:
logger
.
info
(
f
'
smtp = smtplib.SMTP(
{
mail_
cfg
.
Server
}
)
'
)
logger
.
info
(
f
'
smtp.sendmail(
{
mail_
cfg
.
Sender
}
,
{
mail_
cfg
.
Admin_email
}
, message)
'
)
logger
.
info
(
f
'
smtp = smtplib.SMTP(
{
r
cfg
.
Server
}
)
'
)
logger
.
info
(
f
'
smtp.sendmail(
{
r
cfg
.
Sender
}
,
{
r
cfg
.
Admin_email
}
, message)
'
)
logger
.
info
(
message
)
else
:
smtp
=
smtplib
.
SMTP
(
mail_
cfg
.
Server
)
smtp
.
sendmail
(
mail_
cfg
.
Sender
,
receivers
,
message
)
smtp
=
smtplib
.
SMTP
(
r
cfg
.
Server
)
smtp
.
sendmail
(
r
cfg
.
Sender
,
receivers
,
message
)
logger
.
debug
(
f
'
User report sent to:
{
mail_
cfg
.
Admin_email
}
'
)
logger
.
debug
(
f
'
User report sent to:
{
r
cfg
.
Admin_email
}
'
)
def
insert_db
(
username
,
msg
):
...
...
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