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
12e99e55
Commit
12e99e55
authored
5 years ago
by
Bo-Chun Chen
Browse files
Options
Downloads
Patches
Plain Diff
Remove slapcat and related
parent
04856761
No related branches found
Branches containing commit
No related tags found
Tags containing commit
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
+2
-12
2 additions, 12 deletions
git_commit.py
with
2 additions
and
12 deletions
git_commit.py
+
2
−
12
View file @
12e99e55
...
...
@@ -14,10 +14,7 @@ rc_rmq = RCRMQ({'exchange': 'RegUsr', 'exchange_type': 'topic'})
# Define some location
repo_location
=
os
.
path
.
expanduser
(
'
~/git/rc-users
'
)
cheaha_ldif
=
repo_location
+
'
/users/cheaha-openldap.ldif
'
cheaha_ldapsearch_ldif
=
repo_location
+
'
/users/cheaha-openldap-ldapsearch.ldif
'
slapcat_bin
=
'
/cm/local/apps/openldap/sbin/slapcat
'
slapd_conf
=
'
/cm/local/apps/openldap/etc/slapd.conf
'
# Default logger level
logger_lvl
=
logging
.
WARNING
...
...
@@ -33,12 +30,10 @@ if args.verbose:
if
not
args
.
dry_run
:
git
=
sh
.
git
.
bake
(
'
-C
'
,
repo_location
)
slapcat
=
sh
.
Command
(
slapcat_bin
)
ldapsearch
=
sh
.
Command
(
'
ldapsearch
'
)
else
:
logger_lvl
=
logging
.
INFO
git
=
sh
.
echo
.
bake
(
'
git
'
,
'
-C
'
,
repo_location
)
slapcat
=
sh
.
echo
.
bake
(
slapcat_bin
)
ldapsearch
=
sh
.
echo
.
bake
(
'
ldapsearch
'
)
# Logger
...
...
@@ -66,19 +61,14 @@ def git_commit(ch, method, properties, body):
logger
.
debug
(
'
git checkout -b %s
'
,
branch_name
)
git
.
checkout
(
'
-b
'
,
branch_name
)
logger
.
debug
(
"
open(%s,
'
w
'
), open(%s,
'
w
'
)
"
,
cheaha_ldif
,
cheaha_ldapsearch_ldif
)
with
open
(
cheaha_ldif
,
'
w
'
)
as
ldif_f
,
\
open
(
cheaha_ldapsearch_ldif
,
'
w
'
)
as
ldapsearch_ldif_f
:
logger
.
debug
(
"
%s -f %s -b
'
dc=cm,dc=cluster
'
> %s
"
,
slapcat_bin
,
slapcat_config
,
cheaha_ldif
)
slapcat
(
'
-f
'
,
slapd_conf
,
'
-b
'
,
"'
dc=cm,dc=cluster
'"
,
_out
=
ldif_f
)
logger
.
debug
(
"
open(%s,
'
w
'
)
"
,
cheaha_ldapsearch_ldif
)
with
open
(
cheaha_ldapsearch_ldif
,
'
w
'
)
as
ldapsearch_ldif_f
:
logger
.
debug
(
"
ldapsearch -LLL -x -h ldapserver -b
'
dc=cm,dc=cluster
'
> %s
"
,
ldapsearch_ldif
)
ldapsearch
(
'
-LLL
'
,
'
-x
'
,
'
-h
'
,
'
ldapserver
'
,
'
-b
'
,
"'
dc=cm,dc=cluster
'"
,
_out
=
ldapsearch_ldif_f
)
logger
.
info
(
'
ldif files generated.
'
)
logger
.
debug
(
'
git diff
'
)
git
.
diff
()
logger
.
debug
(
'
git add %s
'
,
cheaha_ldif
)
git
.
add
(
cheaha_ldif
)
logger
.
debug
(
'
git add %s
'
,
cheaha_ldapsearch_ldif
)
git
.
add
(
cheaha_ldapsearch_ldif
)
logger
.
debug
(
"
git commit -m
'
Added new cheaha user: %s
'"
,
branch_name
)
...
...
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