Commit 0216d4b9 authored by Ayush Tiwari's avatar Ayush Tiwari

Fix logging

parent 970dd4d4
import doctest
from zope.testing import renormalizing
import logging
import os
import re
import shutil
......@@ -9,7 +10,6 @@ import subprocess
import tempfile
import unittest
import zc.buildout.testing
from logging import log
from subprocess import check_call, check_output
from slapos.recipe.gitclone import GIT_CLONE_ERROR_MESSAGE, \
GIT_CLONE_CACHE_ERROR_MESSAGE
......@@ -89,7 +89,7 @@ class GitCloneNonInformativeTests(unittest.TestCase):
subprocess.check_call('git add .', cwd=proj_dir, shell=True)
except subprocess.CalledProcessError as e:
# XXX: This is ugly and old. Change it before review
log.error("'git add .' failed with '{}'".format(e.returncode))
logging.error("'git add .' failed with '{}'".format(e.returncode))
def git_commit(self, proj_dir, msg):
"""runs a 'git commit -m msg' in the provided git repo
......@@ -98,7 +98,7 @@ class GitCloneNonInformativeTests(unittest.TestCase):
try:
subprocess.check_call('git commit -m "{}"'.format(msg), cwd=proj_dir, shell=True)
except subprocess.CalledProcessError as e:
log.error("'git commit' failed with '{}'".format(e.returncode))
logging.error("'git commit' failed with '{}'".format(e.returncode))
def get_repo_head_commit(self, proj_dir, branch='master'):
"""
......@@ -109,7 +109,7 @@ class GitCloneNonInformativeTests(unittest.TestCase):
cwd=proj_dir, shell=True).decode("utf-8")
return output.rstrip()
except subprocess.CalledProcessError :
log.error("failed to call 'git rev-parse'")
logging.error("failed to call 'git rev-parse'")
return None
def makeGitCloneRecipe(self, options):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment