grim/bitshifter

Fix some stupid bugs
draft
2020-01-31, Gary Kramlich
116dbee5fa96
Parents 87ac5b752969
Children f03134f669fb
Fix some stupid bugs
--- a/bitshifter.py Fri Jan 31 06:50:57 2020 -0600
+++ b/bitshifter.py Fri Jan 31 06:55:40 2020 -0600
@@ -35,29 +35,29 @@
if 'repository' in data:
repo = data.get('repository')
- path = os.path.join('respositories', repo.get('full_name'))
+ path = os.path.join('repos', repo.get('full_name'))
if not os.path.isdir(path):
msg = f'unknown repository {repo.get("full_name")}'
- log.error(msg)
+ logging.error(msg)
return make_response((msg, 400))
vcs_cls = VCS_TOOLS.get(repo.get('scm'), None)
if vcs_cls is None:
msg = f'unknown vcs {repo.get("scm")}'
- log.error(msg)
+ logging.error(msg)
return make_response((msg, 400))
- vcs = vcs_cls(repo.get('full_name'))
+ vcs = vcs_cls(path)
try:
out = subprocess.check_output(vcs.pull().split())
- log.info(out)
+ logging.info(out)
out = subprocess.check_output(vcs.push().split())
- log.info(out)
+ logging.info(out)
except subprocess.CalledProcessError as exp:
if exp.returncode == 1:
- log.info(exp.output)
+ logging.info(exp.output)
return make_response((exp.output, 500))