Skip to content
Snippets Groups Projects
Commit 86631358 authored by Bo-Chun Chen's avatar Bo-Chun Chen
Browse files

Add debug message

parent 108d8cdc
No related branches found
No related tags found
6 merge requests!147Merge previous default branch feat-cod-rmq into main,!85kill nginx process running under user from login node,!51Fix acct create wait,!39WIP:Feat cod rmq,!38WIP: Feat cod rmq,!21Feat git commit agent
...@@ -27,23 +27,39 @@ def git_commit(ch, method, properties, body): ...@@ -27,23 +27,39 @@ def git_commit(ch, method, properties, body):
try: try:
git.checkout('master') if DEBUG:
git.pull() print('[{}]: git checkout master'.format(task))
git.checkout('-b', branch_name) print('[{}]: git pull'.format(task))
print('[{}]: git checkout -b {}'.format(task, branch_name))
with open(cheaha_ldif, 'w') as ldif_f,\ print('[{}]: /cm/local/apps/openldap/sbin/slapcat\\'.format(task))
open(cheaha_ldapsearch_ldif, 'w') as ldapsearch_ldif_f: print("\t-f /cm/local/apps/openldap/etc/slapd.conf -b 'dc=cm,dc=cluster' > {}".format(cheaha_ldif))
slapcat('-f', '/cm/local/apps/openldap/etc/slapd.conf', '-b', "'dc=cm,dc=cluster'", _out=ldif_f) print('[{}]: ldapsearch\\'.format(task))
ldapsearch('-LLL', '-x', '-h', 'cheaha-master02', '-b', "'dc=cm,dc=cluster'", _out=ldapsearch_ldif_f) print("\t-LLL -x -h cheaha-master02 -b 'dc=cm,dc=cluster'".format(cheaha_ldapsearch_ldif))
print('[{}]: git add {}'.format(task, cheaha_ldif))
git.diff() print('[{}]: git add {}'.format(task, cheaha_ldapsearch_ldif))
git.add(cheaha_ldif) print('[{}]: git commit -m "{}"'.format(task, "Added new cheaha user: " + username))
git.add(cheaha_ldapsearch_ldif) print('[{}]: git push origin'.format(task))
git.commit(m="Added new cheaha user: " + username) print('[{}]: git checkout master'.format(task))
git.push('origin', branch_name) print('[{}]: git pull'.format(task))
git.checkout('master')
time.sleep(60) else:
git.pull() git.checkout('master')
git.pull()
git.checkout('-b', branch_name)
with open(cheaha_ldif, 'w') as ldif_f,\
open(cheaha_ldapsearch_ldif, 'w') as ldapsearch_ldif_f:
slapcat('-f', '/cm/local/apps/openldap/etc/slapd.conf', '-b', "'dc=cm,dc=cluster'", _out=ldif_f)
ldapsearch('-LLL', '-x', '-h', 'cheaha-master02', '-b', "'dc=cm,dc=cluster'", _out=ldapsearch_ldif_f)
git.diff()
git.add(cheaha_ldif)
git.add(cheaha_ldapsearch_ldif)
git.commit(m="Added new cheaha user: " + username)
git.push('origin', branch_name)
git.checkout('master')
time.sleep(60)
git.pull()
success = True success = True
except: except:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment