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

Fix git current working directory syntax

Also, add os module to expand ~ to user home
parent 8aba1392
Branches nklick-0.15.3
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
#!/usr/bin/env python
import os
import sh
import sys
import json
......@@ -10,7 +11,7 @@ task = 'git_commit'
# Instantiate rabbitmq object
rc_rmq = RCRMQ({'exchange': 'RegUsr', 'exchange_type': 'topic'})
repo_location = '~/git/rc-users'
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'
......@@ -20,7 +21,7 @@ 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()
git = sh.git.bake(repo_location)
git = sh.git.bake('-C', repo_location)
slapcat = sh.Command('/cm/local/apps/openldap/sbin/slapcat')
ldapsearch = sh.Command('ldapsearch')
......
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