Skip to content
This repository was archived by the owner on Oct 23, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ language: python
python:
- "2.7"
install:
- pip install -r test_requirements.txt --use-mirrors
- pip install -r test_requirements.txt
script: bash test.sh -q
after_success:
coveralls
2 changes: 1 addition & 1 deletion gitreload/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def configure_logging(level_override=None):
elif os.path.exists('/var/run/syslog'):
address = '/var/run/syslog'
else:
address = ('127.0.0.1', 514)
address = ('127.0.0.1', 514) # pylint: disable=redefined-variable-type
# Add syslog handler before adding formatters
root_logger.addHandler(
SysLogHandler(address=address, facility=SysLogHandler.LOG_LOCAL0)
Expand Down
11 changes: 7 additions & 4 deletions gitreload/processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ def import_repo(action_call):
'--settings={0}'.format(settings['DJANGO_SETTINGS']),
'git_add_course',
action_call.repo_url,
'--directory_path',
os.path.join(settings['REPODIR'], action_call.repo_name),
]

Expand Down Expand Up @@ -157,10 +158,12 @@ def run(self): # pragma: no cover due to multiprocessing
"""
while True:
action_call = self.queue.get()
log.info('Starting GitAction task {0} out '
'of {1} on thread {2}'.format(
action_call, len(self.queued_jobs), self.thread_num
))
log.info(
'Starting GitAction task %s out of %s on thread %s',
action_call,
len(self.queued_jobs),
self.thread_num
)
try:
log.debug('Used %s as index to ACTION_COMMANDS',
action_call.action_type)
Expand Down
6 changes: 3 additions & 3 deletions gitreload/tests/test_config.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
"""
Unit tests to validate configuration loading
"""
import mock
import os
import unittest
import mock

from .base import TEST_ROOT

Expand Down Expand Up @@ -139,7 +139,7 @@ def test_syslog_devices(self):
# Nuke syslog handlers from init
syslog_handlers = []
for handler in root_logger.handlers:
if type(handler) is logging.handlers.SysLogHandler:
if isinstance(handler, logging.handlers.SysLogHandler):
syslog_handlers.append(handler)
for handler in syslog_handlers:
root_logger.removeHandler(handler)
Expand All @@ -163,7 +163,7 @@ def mock_effect(*args):
configure_logging()
syslog_handler = None
for handler in root_logger.handlers:
if type(handler) is logging.handlers.SysLogHandler:
if isinstance(handler, logging.handlers.SysLogHandler):
syslog_handler = handler
self.assertIsNotNone(syslog_handler)
if log_device == '':
Expand Down
3 changes: 2 additions & 1 deletion gitreload/tests/test_processing.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
"""
Tests related to the processing module
"""
import mock
import os
import shutil
import subprocess
import mock

from git import Repo

Expand Down Expand Up @@ -90,6 +90,7 @@ def test_command_error_and_input(self, mocked_logging):
'--settings=aws',
'git_add_course',
'NOTREAL',
'--directory_path',
'/mnt/data/repos/NOTREAL'],
cwd='/edx/app/edxapp/edx-platform',
stderr=-2
Expand Down
2 changes: 1 addition & 1 deletion gitreload/tests/test_web.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
import mock
from git import Repo

from .base import GitreloadTestBase
import gitreload.web
from .base import GitreloadTestBase


class TestWebApplication(GitreloadTestBase):
Expand Down