Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
rabbitmq_agents
Manage
Activity
Members
Labels
Plan
Issues
14
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
9d7d6928
Commit
9d7d6928
authored
5 years ago
by
Bo-Chun Chen
Browse files
Options
Downloads
Patches
Plain Diff
Utilize logger from rc_util
parent
859e1b74
No related branches found
No related tags found
6 merge requests
!147
Merge previous default branch feat-cod-rmq into main
,
!85
kill nginx process running under user from login node
,
!51
Fix acct create wait
,
!39
WIP:Feat cod rmq
,
!38
WIP: Feat cod rmq
,
!21
Feat git commit agent
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
git_commit.py
+3
-18
3 additions, 18 deletions
git_commit.py
with
3 additions
and
18 deletions
git_commit.py
+
3
−
18
View file @
9d7d6928
...
...
@@ -3,8 +3,7 @@ import os
import
sh
import
sys
import
json
import
argparse
import
logging
import
rc_util
from
rc_rmq
import
RCRMQ
task
=
'
git_commit
'
...
...
@@ -17,17 +16,8 @@ repo_location = os.path.expanduser('~/git/rc-users')
users_dir
=
repo_location
+
'
/users
'
groups_dir
=
repo_location
+
'
/groups
'
# Default logger level
logger_lvl
=
logging
.
WARNING
# Parse arguments
parser
=
argparse
.
ArgumentParser
()
parser
.
add_argument
(
'
-v
'
,
'
--verbose
'
,
action
=
'
store_true
'
,
help
=
'
verbose output
'
)
parser
.
add_argument
(
'
-n
'
,
'
--dry-run
'
,
action
=
'
store_true
'
,
help
=
'
enable dry run mode
'
)
args
=
parser
.
parse_args
()
if
args
.
verbose
:
logger_lvl
=
logging
.
DEBUG
args
=
rc_util
.
get_args
()
logger
=
rc_util
.
get_logger
(
args
)
if
not
args
.
dry_run
:
git
=
sh
.
git
.
bake
(
'
-C
'
,
repo_location
)
...
...
@@ -37,11 +27,6 @@ else:
git
=
sh
.
echo
.
bake
(
'
git
'
,
'
-C
'
,
repo_location
)
ldapsearch
=
sh
.
echo
.
bake
(
'
ldapsearch
'
)
# Logger
logging
.
basicConfig
(
format
=
'
%(asctime)s [%(module)s] - %(message)s
'
,
level
=
logger_lvl
)
logger
=
logging
.
getLogger
(
__name__
)
def
git_commit
(
ch
,
method
,
properties
,
body
):
msg
=
json
.
loads
(
body
)
username
=
msg
[
'
username
'
]
...
...
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