#1335 move copr backend sources to default python path
Merged 3 years ago by praiskup. Opened 3 years ago by praiskup.
Unknown source move-stuff-to-pythonpath  into  master

@@ -6,7 +6,6 @@

  [Service]

  Type=simple

  PIDFile=/var/run/copr-backend/copr-be.pid

- Environment="PYTHONPATH=/usr/share/copr/"

  User=copr

  Group=copr

  ExecStart=/usr/bin/copr_be.py

file modified
+6 -7
@@ -110,14 +110,15 @@

  

  %build

  make -C docs %{?_smp_mflags} html

+ %py3_build

  

  

  %install

- install -d %{buildroot}%{_sharedstatedir}/copr

- install -d %{buildroot}%{_sharedstatedir}/copr/jobs

+ %py3_install

+ 

+ 

  install -d %{buildroot}%{_sharedstatedir}/copr/public_html/results

  install -d %{buildroot}%{_pkgdocdir}/lighttpd/

- install -d %{buildroot}%{_datadir}/copr/backend

  install -d %{buildroot}%{_sysconfdir}/copr

  install -d %{buildroot}%{_sysconfdir}/logrotate.d/

  install -d %{buildroot}%{_unitdir}
@@ -130,7 +131,6 @@

  install -d %{buildroot}%{_bindir}/

  

  cp -a copr-backend-service %{buildroot}/%{_sbindir}/

- cp -a backend/* %{buildroot}%{_datadir}/copr/backend

  cp -a run/* %{buildroot}%{_bindir}/

  cp -a conf/copr-be.conf.example %{buildroot}%{_sysconfdir}/copr/copr-be.conf

  
@@ -162,7 +162,6 @@

  

  cp -a docs/build/html %{buildroot}%{_pkgdocdir}/

  

- %py_byte_compile %{__python3} %{buildroot}%{_datadir}/copr/backend

  

  %check

  ./run_tests.sh
@@ -184,10 +183,10 @@

  

  %files

  %license LICENSE

+ %python3_sitelib/copr_backend

+ %python3_sitelib/copr_backend*egg-info

  

- %{_datadir}/copr/*

  %dir %{_sharedstatedir}/copr

- %dir %attr(0755, copr, copr) %{_sharedstatedir}/copr/jobs/

  %dir %attr(0755, copr, copr) %{_sharedstatedir}/copr/public_html/

  %dir %attr(0755, copr, copr) %{_sharedstatedir}/copr/public_html/results

  %dir %attr(0755, copr, copr) %{_var}/run/copr-backend

backend/copr_backend/__init__.py backend/backend/__init__.py
file renamed
file was moved with no change to the file
backend/copr_backend/actions.py backend/backend/actions.py
file renamed
+2 -2
@@ -25,7 +25,7 @@

                        get_chroot_arch, cmd_debug, format_filename,

                        uses_devel_repo, call_copr_repo, build_chroot_log_name)

  from .sign import sign_rpms_in_dir, unsign_rpms_in_dir, get_pubkey

- from backend.worker_manager import WorkerManager

+ from copr_backend.worker_manager import WorkerManager

  

  from .vm_manage.manager import VmManager

  
@@ -35,7 +35,7 @@

  class Action(object):

      """ Object to send data back to fronted

  

-     :param backend.callback.FrontendCallback frontent_callback:

+     :param copr_backend.callback.FrontendCallback frontent_callback:

          object to post data back to frontend

  

      :param destdir: filepath with build results

backend/copr_backend/ans_utils.py backend/backend/ans_utils.py
file renamed
file was moved with no change to the file
backend/copr_backend/constants.py backend/backend/constants.py
file renamed
file was moved with no change to the file
backend/copr_backend/createrepo.py backend/backend/createrepo.py
file renamed
+1 -1
@@ -6,7 +6,7 @@

  from oslo_concurrency import lockutils

  

  # todo: add logging here

- # from backend.helpers import BackendConfigReader, get_redis_logger

+ # from copr_backend.helpers import BackendConfigReader, get_redis_logger

  # opts = BackendConfigReader().read()

  # log = get_redis_logger(opts, "createrepo", "actions")

  

backend/copr_backend/daemons/__init__.py backend/backend/daemons/__init__.py
file renamed
file was moved with no change to the file
backend/copr_backend/daemons/action_dispatcher.py backend/backend/daemons/action_dispatcher.py
file renamed
+2 -2
@@ -4,8 +4,8 @@

  import multiprocessing

  from setproctitle import setproctitle

  

- from backend.frontend import FrontendClient

- from backend.exceptions import FrontendClientException

+ from copr_backend.frontend import FrontendClient

+ from copr_backend.exceptions import FrontendClientException

  

  from ..actions import ActionWorkerManager, ActionQueueTask

  from ..helpers import get_redis_logger, get_redis_connection

backend/copr_backend/daemons/backend.py backend/backend/daemons/backend.py
file renamed
+1 -1
@@ -6,7 +6,7 @@

  

  import lockfile

  from daemon import DaemonContext

- from backend.frontend import FrontendClient

+ from copr_backend.frontend import FrontendClient

  

  from ..exceptions import CoprBackendError, FrontendClientException

  from ..helpers import BackendConfigReader, get_redis_logger

backend/copr_backend/daemons/build_dispatcher.py backend/backend/daemons/build_dispatcher.py
file renamed
+1 -2
@@ -1,6 +1,5 @@

  # coding: utf-8

  

- import os

  import time

  import multiprocessing

  
@@ -8,7 +7,7 @@

  

  from setproctitle import setproctitle

  

- from backend.frontend import FrontendClient

+ from copr_backend.frontend import FrontendClient

  

  from ..helpers import get_redis_logger, call_copr_repo

  from ..exceptions import (DispatchBuildError, NoVmAvailable,

backend/copr_backend/daemons/log.py backend/backend/daemons/log.py
file renamed
file was moved with no change to the file
backend/copr_backend/daemons/vm_master.py backend/backend/daemons/vm_master.py
file renamed
file was moved with no change to the file
backend/copr_backend/daemons/worker.py backend/backend/daemons/worker.py
file renamed
file was moved with no change to the file
backend/copr_backend/exceptions.py backend/backend/exceptions.py
file renamed
file was moved with no change to the file
backend/copr_backend/frontend.py backend/backend/frontend.py
file renamed
+1 -1
@@ -3,7 +3,7 @@

  import logging

  from requests import get, post, put, RequestException

  

- from backend.exceptions import FrontendClientException

+ from copr_backend.exceptions import FrontendClientException

  

  # prolong the sleep time before asking frontend again

  SLEEP_INCREMENT_TIME = 5

backend/copr_backend/helpers.py backend/backend/helpers.py
file renamed
+2 -2
@@ -30,9 +30,9 @@

  from redis import StrictRedis

  

  from copr.client import CoprClient

- from backend.constants import DEF_BUILD_USER, DEF_BUILD_TIMEOUT, DEF_CONSECUTIVE_FAILURE_THRESHOLD, \

+ from copr_backend.constants import DEF_BUILD_USER, DEF_BUILD_TIMEOUT, DEF_CONSECUTIVE_FAILURE_THRESHOLD, \

      CONSECUTIVE_FAILURE_REDIS_KEY, default_log_format

- from backend.exceptions import CoprBackendError, CoprBackendSrpmError

+ from copr_backend.exceptions import CoprBackendError, CoprBackendSrpmError

  

  from . import constants

  

backend/copr_backend/job.py backend/backend/job.py
file renamed
+1 -1
@@ -1,7 +1,7 @@

  import copy

  import os

  

- from backend.helpers import build_target_dir, build_chroot_log_name

+ from copr_backend.helpers import build_target_dir, build_chroot_log_name

  

  

  class BuildJob(object):

backend/copr_backend/mockremote/__init__.py backend/backend/mockremote/__init__.py
file renamed
file was moved with no change to the file
backend/copr_backend/mockremote/builder.py backend/backend/mockremote/builder.py
file renamed
+1 -1
@@ -2,7 +2,7 @@

  import pipes

  from subprocess import Popen

  

- from backend.vm_manage import PUBSUB_INTERRUPT_BUILDER

+ from copr_backend.vm_manage import PUBSUB_INTERRUPT_BUILDER

  

  import gi

  gi.require_version('Modulemd', '1.0')

backend/copr_backend/msgbus.py backend/backend/msgbus.py
file renamed
file was moved with no change to the file
backend/copr_backend/sign.py backend/backend/sign.py
file renamed
file was moved with no change to the file
backend/copr_backend/sshcmd.py backend/backend/sshcmd.py
file renamed
file was moved with no change to the file
backend/copr_backend/vm_manage/__init__.py backend/backend/vm_manage/__init__.py
file renamed
file was moved with no change to the file
backend/copr_backend/vm_manage/check.py backend/backend/vm_manage/check.py
file renamed
+4 -4
@@ -4,9 +4,9 @@

  # from multiprocessing import Process

  #from threading import Thread

  

- from backend.helpers import get_redis_connection

- from backend.vm_manage import PUBSUB_MB, EventTopics

- from backend.vm_manage.executor import Executor

+ from copr_backend.helpers import get_redis_connection

+ from copr_backend.vm_manage import PUBSUB_MB, EventTopics

+ from copr_backend.vm_manage.executor import Executor

  

  from ..helpers import get_redis_logger

  from ..sshcmd import SSHConnection
@@ -17,7 +17,7 @@

      Test connectivity to the VM

  

      :param vm_ip: ip address to the newly created VM

-     :raises: :py:class:`~backend.exceptions.CoprWorkerSpawnFailError`: validation fails

+     :raises: :py:class:`~copr_backend.exceptions.CoprWorkerSpawnFailError`: validation fails

      """

      log = get_redis_logger(opts, "vmm.check_health.detached", "vmm")

  

backend/copr_backend/vm_manage/event_handle.py backend/backend/vm_manage/event_handle.py
file renamed
+3 -3
@@ -5,9 +5,9 @@

  import time

  from setproctitle import setproctitle

  

- from backend.exceptions import VmDescriptorNotFound

- from backend.helpers import get_redis_logger

- from backend.vm_manage import VmStates, PUBSUB_MB, EventTopics

+ from copr_backend.exceptions import VmDescriptorNotFound

+ from copr_backend.helpers import get_redis_logger

+ from copr_backend.vm_manage import VmStates, PUBSUB_MB, EventTopics

  

  

  class Recycle(Thread):

backend/copr_backend/vm_manage/executor.py backend/backend/vm_manage/executor.py
file renamed
file was moved with no change to the file
backend/copr_backend/vm_manage/manager.py backend/backend/vm_manage/manager.py
file renamed
+2 -2
@@ -7,9 +7,9 @@

  import tabulate

  import humanize

  from io import StringIO

- from backend.exceptions import VmError, NoVmAvailable, VmDescriptorNotFound

+ from copr_backend.exceptions import VmError, NoVmAvailable, VmDescriptorNotFound

  

- from backend.helpers import get_redis_connection

+ from copr_backend.helpers import get_redis_connection

  from .models import VmDescriptor

  from . import VmStates, KEY_VM_INSTANCE, KEY_VM_POOL, EventTopics, PUBSUB_MB, KEY_SERVER_INFO, \

      KEY_VM_POOL_INFO

backend/copr_backend/vm_manage/models.py backend/backend/vm_manage/models.py
file renamed
+1 -1
@@ -1,7 +1,7 @@

  # coding: utf-8

  

  from pprint import pformat

- from backend.exceptions import VmDescriptorNotFound

+ from copr_backend.exceptions import VmDescriptorNotFound

  from . import KEY_VM_INSTANCE

  

  

backend/copr_backend/vm_manage/spawn.py backend/backend/vm_manage/spawn.py
file renamed
+3 -3
@@ -7,9 +7,9 @@

  

  from netaddr import IPAddress

  

- from backend.helpers import get_redis_connection

- from backend.vm_manage import PUBSUB_MB, EventTopics

- from backend.vm_manage.executor import Executor

+ from copr_backend.helpers import get_redis_connection

+ from copr_backend.vm_manage import PUBSUB_MB, EventTopics

+ from copr_backend.vm_manage.executor import Executor

  from ..ans_utils import run_ansible_playbook_cli

  from ..exceptions import CoprSpawnFailError

  from ..helpers import get_redis_logger

backend/copr_backend/vm_manage/terminate.py backend/backend/vm_manage/terminate.py
file renamed
+5 -5
@@ -2,11 +2,11 @@

  import json

  import os

  import time

- from backend.ans_utils import ans_extra_vars_encode, run_ansible_playbook_cli

- from backend.exceptions import CoprSpawnFailError

- from backend.helpers import get_redis_connection

- from backend.vm_manage import EventTopics, PUBSUB_MB

- from backend.vm_manage.executor import Executor

+ from copr_backend.ans_utils import ans_extra_vars_encode, run_ansible_playbook_cli

+ from copr_backend.exceptions import CoprSpawnFailError

+ from copr_backend.helpers import get_redis_connection

+ from copr_backend.vm_manage import EventTopics, PUBSUB_MB

+ from copr_backend.vm_manage.executor import Executor

  from ..helpers import get_redis_logger

  

  

backend/copr_backend/worker_manager.py backend/backend/worker_manager.py
file renamed
file was moved with no change to the file
@@ -149,35 +149,30 @@

  command=/usr/bin/copr_run_logger.py

  user=root

  group=root

- environment=PYTHONPATH="/usr/share/copr/"

  priority=901

  

  [program:copr-backend-vmm]

  command=/usr/bin/copr_run_vmm.py

  user=root

  group=root

- environment=PYTHONPATH="/usr/share/copr/"

  priority=902

  

  [program:copr-backend-build]

  command=/usr/bin/copr_run_build_dispatcher.py

  user=root

  group=root

- environment=PYTHONPATH="/usr/share/copr/"

  priority=903

  

  [program:copr-backend-action]

  command=/usr/bin/copr_run_action_dispatcher.py

  user=root

  group=root

- environment=PYTHONPATH="/usr/share/copr/"

  priority=904

  

  [program:copr-backend]

  command=/usr/bin/copr_be.py -u root -g root

  user=root

  group=root

- environment=PYTHONPATH="/usr/share/copr/"

  priority=903

  

  [include]

@@ -3,13 +3,8 @@

  

  import sys

  

- from redis import StrictRedis

- 

- sys.path.append("/usr/share/copr/")

- 

- 

- from backend.helpers import BackendConfigReader, get_redis_connection

- from backend.constants import CONSECUTIVE_FAILURE_REDIS_KEY

+ from copr_backend.helpers import BackendConfigReader, get_redis_connection

+ from copr_backend.constants import CONSECUTIVE_FAILURE_REDIS_KEY

  

  

  def main():

@@ -8,7 +8,6 @@

  import logging

  import argparse

  

- from datetime import datetime

  from concurrent.futures import ThreadPoolExecutor, as_completed

  from dateutil.parser import parse as dt_parse

  
@@ -18,14 +17,12 @@

  # don't kill younger VMs than this (minutes)

  SPAWN_TIMEOUT = 10

  

- sys.path.append("/usr/share/copr/")

- 

- from backend.helpers import BackendConfigReader

- from backend.helpers import utc_now

+ from copr_backend.helpers import BackendConfigReader

+ from copr_backend.helpers import utc_now

  

  try:

-     from backend.vm_manage.manager import VmManager

-     from backend.vm_manage import VmStates

+     from copr_backend.vm_manage.manager import VmManager

+     from copr_backend.vm_manage import VmStates

  except ImportError:

      VmManager = None

  

@@ -2,18 +2,15 @@

  

  import os

  import sys

- import time

  import daemon

  import argparse

  import logging

  import contextlib

  

- sys.path.append("/usr/share/copr/")

- 

- from backend.helpers import (BackendConfigReader, get_redis_logger,

+ from copr_backend.helpers import (BackendConfigReader, get_redis_logger,

                               get_redis_connection)

- from backend.frontend import FrontendClient

- from backend.actions import Action, ActionResult

+ from copr_backend.frontend import FrontendClient

+ from copr_backend.actions import Action, ActionResult

  

  

  def get_arg_parser():

file modified
+1 -3
@@ -84,9 +84,7 @@

  def process_backend_config(opts):

      # obtain backend options

      try:

-         # meh, we should add our sources to default pythonpath

-         sys.path.append("/usr/share/copr/")

-         from backend.helpers import get_redis_logger, BackendConfigReader

+         from copr_backend.helpers import get_redis_logger, BackendConfigReader

          config = "/etc/copr/copr-be.conf"

          opts.backend_opts = BackendConfigReader(config).read()

          opts.results_baseurl = opts.backend_opts.results_baseurl

file modified
+1 -1
@@ -7,7 +7,7 @@

  

  from munch import Munch

  

- from backend.daemons.backend import run_backend

+ from copr_backend.daemons.backend import run_backend

  

  

  def parse_args(args):

@@ -13,10 +13,8 @@

  log = logging.getLogger(__name__)

  

  

- sys.path.append("/usr/share/copr/")

- 

- from backend.createrepo import createrepo

- from backend.helpers import SortedOptParser, BackendConfigReader

+ from copr_backend.createrepo import createrepo

+ from copr_backend.helpers import SortedOptParser, BackendConfigReader

  

  

  def main(args):

file modified
+3 -6
@@ -1,17 +1,14 @@

  #!/usr/bin/python3

  

- import shutil

- 

  import sys

  import os

  import logging

  import argparse

  import pwd

  

- sys.path.append("/usr/share/copr/")

- from backend.helpers import BackendConfigReader

- from backend.sign import get_pubkey, unsign_rpms_in_dir, sign_rpms_in_dir, create_user_keys, create_gpg_email

- from backend.createrepo import createrepo_unsafe, add_appdata

+ from copr_backend.helpers import BackendConfigReader

+ from copr_backend.sign import get_pubkey, unsign_rpms_in_dir, sign_rpms_in_dir, create_user_keys, create_gpg_email

+ from copr_backend.createrepo import createrepo_unsafe, add_appdata

  

  logging.basicConfig(

      filename="/var/log/copr-backend/fix_gpg.log",

@@ -2,12 +2,8 @@

  

  # coding: utf-8

  

- import sys

- sys.path.append("/usr/share/copr/")

- 

- 

- from backend.helpers import BackendConfigReader

- from backend.vm_manage.manager import VmManager

+ from copr_backend.helpers import BackendConfigReader

+ from copr_backend.vm_manage.manager import VmManager

  

  

  def main():

@@ -15,13 +15,11 @@

  import netaddr

  import time

  

- sys.path.append("/usr/share/copr/")

- 

  from dateutil.parser import parse as dt_parse

  from netaddr import IPNetwork, IPAddress

  

  from collections import defaultdict

- from backend.helpers import BackendConfigReader

+ from copr_backend.helpers import BackendConfigReader

  

  opts = BackendConfigReader().read()

  

@@ -7,8 +7,7 @@

  from copr.v3 import Client

  from copr.v3.exceptions import CoprNoResultException

  

- sys.path.append("/usr/share/copr/")

- from backend.helpers import BackendConfigReader

+ from copr_backend.helpers import BackendConfigReader

  

  

  def main():
@@ -68,4 +67,4 @@

          print("This script should be executed under the `copr` user")

          sys.exit(1)

      else:

-         main() 

\ No newline at end of file

+         main()

@@ -16,12 +16,10 @@

  from copr.exceptions import CoprException

  from copr.exceptions import CoprRequestException

  

- sys.path.append("/usr/share/copr/")

- 

- from backend.helpers import BackendConfigReader

- from backend.helpers import uses_devel_repo, get_persistent_status, get_auto_prune_status

- from backend.frontend import FrontendClient

- from backend.createrepo import createrepo

+ from copr_backend.helpers import BackendConfigReader

+ from copr_backend.helpers import uses_devel_repo, get_persistent_status, get_auto_prune_status

+ from copr_backend.frontend import FrontendClient

+ from copr_backend.createrepo import createrepo

  

  DEF_DAYS = 14

  

@@ -1,12 +1,14 @@

  #!/usr/bin/python3

  # coding: utf-8

  

- from backend.daemons.action_dispatcher import ActionDispatcher

- from backend.helpers import get_backend_opts

+ from copr_backend.daemons.action_dispatcher import ActionDispatcher

+ from copr_backend.helpers import get_backend_opts

+ 

  

  def main():

      action_dispatcher = ActionDispatcher(get_backend_opts())

      action_dispatcher.run()

  

+ 

  if __name__ == "__main__":

      main()

@@ -1,12 +1,14 @@

  #!/usr/bin/python3

  # coding: utf-8

  

- from backend.daemons.build_dispatcher import BuildDispatcher

- from backend.helpers import get_backend_opts

+ from copr_backend.daemons.build_dispatcher import BuildDispatcher

+ from copr_backend.helpers import get_backend_opts

+ 

  

  def main():

      build_dispatcher = BuildDispatcher(get_backend_opts())

      build_dispatcher.run()

  

+ 

  if __name__ == "__main__":

      main()

@@ -1,8 +1,8 @@

  #!/usr/bin/python3

  # coding: utf-8

  

- from backend.helpers import get_backend_opts

- from backend.daemons.log import RedisLogHandler

+ from copr_backend.helpers import get_backend_opts

+ from copr_backend.daemons.log import RedisLogHandler

  

  

  def main():

file modified
+7 -7
@@ -3,13 +3,13 @@

  

  from setproctitle import setproctitle

  

- from backend.vm_manage.manager import VmManager

- from backend.vm_manage.spawn import Spawner

- from backend.vm_manage.event_handle import EventHandler

- from backend.vm_manage.terminate import Terminator

- from backend.vm_manage.check import HealthChecker

- from backend.daemons.vm_master import VmMaster

- from backend.helpers import get_redis_logger, get_backend_opts

+ from copr_backend.vm_manage.manager import VmManager

+ from copr_backend.vm_manage.spawn import Spawner

+ from copr_backend.vm_manage.event_handle import EventHandler

+ from copr_backend.vm_manage.terminate import Terminator

+ from copr_backend.vm_manage.check import HealthChecker

+ from copr_backend.daemons.vm_master import VmMaster

+ from copr_backend.helpers import get_redis_logger, get_backend_opts

  

  

  class VmmRunner(object):

@@ -4,7 +4,6 @@

  """

  One-time run script to sign unsigned rpms and  place pubkey gpg to the all projects.

  """

- import shutil

  

  import sys

  import os
@@ -19,12 +18,11 @@

  log = logging.getLogger(__name__)

  

  

- sys.path.append("/usr/share/copr/")

- from backend.helpers import (BackendConfigReader, create_file_logger,

+ from copr_backend.helpers import (BackendConfigReader, create_file_logger,

                               uses_devel_repo)

- from backend.sign import get_pubkey, sign_rpms_in_dir, create_user_keys

- from backend.exceptions import CoprSignNoKeyError

- from backend.createrepo import createrepo

+ from copr_backend.sign import get_pubkey, sign_rpms_in_dir, create_user_keys

+ from copr_backend.exceptions import CoprSignNoKeyError

+ from copr_backend.createrepo import createrepo

  

  

  def check_signed_rpms_in_pkg_dir(pkg_dir, user, project, chroot, chroot_dir, opts, devel):
@@ -104,8 +102,6 @@

  

  

  def main():

-     # shutil.rmtree("/tmp/users_failed.txt", ignore_errors=True)

-     # shutil.rmtree("/tmp/users_done.txt", ignore_errors=True)

      users_done_old = set()

      try:

          with open("/tmp/users_done.txt") as handle:

file modified
+2 -3
@@ -4,11 +4,10 @@

  NUM_QUEUES = 2

  

  import sys

- sys.path.append("/usr/share/copr/")

  

  from retask.task import Task

  from retask.queue import Queue

- from backend.helpers import BackendConfigReader

+ from copr_backend.helpers import BackendConfigReader

  

  opts = BackendConfigReader().read()

  redis_config = {
@@ -24,7 +23,7 @@

      save_q = []

      while q.length != 0:

          task = q.dequeue()

-         print task.data

+         print(task.data)

          save_q.append(task)

      for t in save_q:

          q.enqueue(t)

file added
+29
@@ -0,0 +1,29 @@

+ #!/usr/bin/python

+ 

+ from setuptools import setup

+ 

+ long_description = """\

+ COPR is lightweight build system. It allows you to create new project in WebUI,

+ and submit new builds and COPR will create yum repository from latest builds.

+ 

+ This package contains backend."""

+ 

+ __description__ = "Python client for copr service."

+ __author__ = "Copr Team"

+ __author_email__ = "copr-team@redhat.com"

+ __url__ = "https://pagure.io/copr/copr"

+ 

+ 

+ setup(

+     name='copr-backend',

+     version="1.132",

+     description=__description__,

+     long_description=long_description,

+     author=__author__,

+     author_email=__author_email__,

+     url=__url__,

+     license='GPLv2+',

+     packages=['copr_backend'],

+     include_package_data=True,

+     zip_safe=False,

+ )

@@ -11,7 +11,7 @@

  

  sys.path.append(os.path.join(WORKDIR, '..'))

  

- from backend.helpers import get_redis_connection

+ from copr_backend.helpers import get_redis_connection

  

  REDIS_OPTS = Munch(

      redis_db=9,

file modified
+1 -1
@@ -10,7 +10,7 @@

  import subprocess

  from unittest import mock

  

- from backend.helpers import call_copr_repo

+ from copr_backend.helpers import call_copr_repo

  

  class CoprTestFixtureContext():

      pass

@@ -10,8 +10,8 @@

  from retask import ConnectionError

  import sys

  

- from backend.daemons.backend import CoprBackend, run_backend

- from backend.exceptions import CoprBackendError

+ from copr_backend.daemons.backend import CoprBackend, run_backend

+ from copr_backend.exceptions import CoprBackendError

  

  from unittest import mock, skip

  from unittest.mock import MagicMock
@@ -22,16 +22,16 @@

  COPR_NAME = "copr_name"

  COPR_VENDOR = "vendor"

  

- MODULE_REF = "backend.daemons.backend" 

+ MODULE_REF = "copr_backend.daemons.backend" 

  

  @pytest.yield_fixture

  def mc_worker():

-     with mock.patch("backend.daemons.worker.Worker") as worker:

+     with mock.patch("copr_backend.daemons.worker.Worker") as worker:

          yield worker

  

  @pytest.yield_fixture

  def mc_time():

-     with mock.patch("backend.daemons.worker.time") as time:

+     with mock.patch("copr_backend.daemons.worker.time") as time:

          yield time

  

  @pytest.yield_fixture
@@ -53,7 +53,7 @@

          self.tmp_dir_path = os.path.join(tempfile.gettempdir(), subdir)

          os.mkdir(self.tmp_dir_path)

  

-         self.bc_patcher = mock.patch("backend.daemons.backend.BackendConfigReader")

+         self.bc_patcher = mock.patch("copr_backend.daemons.backend.BackendConfigReader")

          self.bc = self.bc_patcher.start()

  

          self.config_file = "/dev/null/copr.conf"
@@ -94,8 +94,8 @@

  

          # for run backend

          self.pidfile_path = os.path.join(self.tmp_dir_path, "backend.pid")

-         self.grp_patcher = mock.patch("backend.daemons.backend.grp")

-         self.pwd_patcher = mock.patch("backend.daemons.backend.pwd")

+         self.grp_patcher = mock.patch("copr_backend.daemons.backend.grp")

+         self.pwd_patcher = mock.patch("copr_backend.daemons.backend.pwd")

          self.grp = self.grp_patcher.start()

          self.pwd = self.pwd_patcher.start()

  

@@ -10,15 +10,15 @@

  import shutil

  import time

  

- from backend.constants import BuildStatus

- from backend.exceptions import CoprWorkerError, CoprSpawnFailError, MockRemoteError, NoVmAvailable, VmError

- from backend.job import BuildJob

- from backend.vm_manage.models import VmDescriptor

+ from copr_backend.constants import BuildStatus

+ from copr_backend.exceptions import CoprWorkerError, CoprSpawnFailError, MockRemoteError, NoVmAvailable, VmError

+ from copr_backend.job import BuildJob

+ from copr_backend.vm_manage.models import VmDescriptor

  

  from unittest import mock, skip

  from unittest.mock import MagicMock

  

- from backend.daemons.worker import Worker

+ from copr_backend.daemons.worker import Worker

  

  # TODO: drop these, not needed

  JOB_GRAB_TASK_END_PUBSUB = "unused"
@@ -29,7 +29,7 @@

  COPR_NAME = "copr_name"

  COPR_VENDOR = "vendor"

  

- MODULE_REF = "backend.daemons.worker"

+ MODULE_REF = "copr_backend.daemons.worker"

  

  @pytest.yield_fixture

  def mc_register_build_result(*args, **kwargs):
@@ -289,8 +289,8 @@

              self.worker.starting_build(self.job)

  

      @skip("Fixme or remove, test doesn't work.")

-     @mock.patch("backend.daemons.dispatcher.MockRemote")

-     @mock.patch("backend.daemons.dispatcher.os")

+     @mock.patch("copr_backend.daemons.dispatcher.MockRemote")

+     @mock.patch("copr_backend.daemons.dispatcher.os")

      def test_do_job_failure_on_mkdirs(self, mc_os, mc_mr, init_worker, reg_vm):

          mc_os.path.exists.return_value = False

          mc_os.makedirs.side_effect = IOError()
@@ -360,7 +360,7 @@

          assert "foo.rpm" in os.listdir(self.job.results_dir)

  

      @skip("Fixme or remove, test doesn't work.")

-     @mock.patch("backend.daemons.dispatcher.fedmsg")

+     @mock.patch("copr_backend.daemons.dispatcher.fedmsg")

      def test_init_fedmsg(self, mc_fedmsg, init_worker):

          self.worker.init_fedmsg()

          assert not mc_fedmsg.init.called

@@ -12,19 +12,18 @@

  from unittest import mock

  from unittest.mock import patch, MagicMock

  

- import backend.daemons.log as log_module

- from backend.daemons.log import RedisLogHandler

+ from copr_backend.daemons.log import RedisLogHandler

  

  

  @pytest.yield_fixture

  def mc_logging():

-     with mock.patch("backend.daemons.log.logging") as mc_logging:

+     with mock.patch("copr_backend.daemons.log.logging") as mc_logging:

          yield mc_logging

  

  

  @pytest.yield_fixture

  def mc_setproctitle():

-     with mock.patch("backend.daemons.log.setproctitle") as mc_spt:

+     with mock.patch("copr_backend.daemons.log.setproctitle") as mc_spt:

          yield mc_spt

  

  
@@ -32,7 +31,7 @@

  

      def setup_method(self, method):

  

-         self.mc_mpp_patcher = mock.patch("backend.daemons.log.Process")

+         self.mc_mpp_patcher = mock.patch("copr_backend.daemons.log.Process")

          self.mc_mpp = self.mc_mpp_patcher.start()

  

          self.test_time = time.time()
@@ -67,7 +66,7 @@

  

      # todo: replace with RedisLogHandler + helpers.get_redis_logger

      # def test_constructor(self):

-     #     # with mock.patch("backend.daemons.log.Process.__init__") as mc_pi:

+     #     # with mock.patch("copr_backend.daemons.log.Process.__init__") as mc_pi:

      #     assert not os.path.exists(self.log_file)

      #     assert not os.path.exists(self.log_dir)

      #     cbl = CoprBackendLog(self.opts, self.queue)

@@ -15,11 +15,11 @@

  import shutil

  import os

  

- from backend.helpers import get_redis_connection

- from backend.vm_manage import VmStates

- from backend.vm_manage.manager import VmManager

- from backend.daemons.vm_master import VmMaster

- from backend.exceptions import VmError, VmSpawnLimitReached

+ from copr_backend.helpers import get_redis_connection

+ from copr_backend.vm_manage import VmStates

+ from copr_backend.vm_manage.manager import VmManager

+ from copr_backend.daemons.vm_master import VmMaster

+ from copr_backend.exceptions import VmError, VmSpawnLimitReached

  

  from unittest import mock, skip

  from unittest.mock import patch, MagicMock
@@ -34,7 +34,7 @@

  TODO: look if https://github.com/locationlabs/mockredis can be used

  """

  

- MODULE_REF = "backend.daemons.vm_master"

+ MODULE_REF = "copr_backend.daemons.vm_master"

  

  @pytest.yield_fixture

  def mc_time():
@@ -54,7 +54,7 @@

  

  # @pytest.yield_fixture

  # def mc_time_vmm():

- #     with mock.patch("backend.vm_manage.manager.time") as handle:

+ #     with mock.patch("copr_backend.vm_manage.manager.time") as handle:

  #         yield handle

  

  

@@ -8,7 +8,7 @@

  import time

  import requests

  

- from backend.exceptions import CoprJobGrabError

+ from copr_backend.exceptions import CoprJobGrabError

  

  from retask.queue import Queue

  
@@ -20,11 +20,11 @@

  from unittest.mock import patch, MagicMock, call

  import pytest

  

- from backend.daemons.job_grab import CoprJobGrab

- import backend.actions

+ from copr_backend.daemons.job_grab import CoprJobGrab

+ import copr_backend.actions

  

  

- MODULE_REF = "backend.daemons.job_grab"

+ MODULE_REF = "copr_backend.daemons.job_grab"

  

  @pytest.yield_fixture

  def mc_logging():
@@ -174,7 +174,7 @@

          with pytest.raises(CoprJobGrabError) as err:

              self.jg.route_build_task(self.task_dict_bad_arch)

  

-     @mock.patch("backend.daemons.job_grab.Action", spec=backend.actions.Action)

+     @mock.patch("copr_backend.daemons.job_grab.Action", spec=copr_backend.actions.Action)

      def test_process_action(self, mc_action, init_jg):

          test_action = MagicMock()

  
@@ -184,7 +184,7 @@

          assert expected_call == mc_action.call_args

          assert mc_action.return_value.run.called

  

-     @mock.patch("backend.daemons.job_grab.get")

+     @mock.patch("copr_backend.daemons.job_grab.get")

      def test_load_tasks_error_request(self, mc_get, init_jg):

          mc_get.side_effect = requests.RequestException()

  
@@ -197,7 +197,7 @@

          assert not self.jg.route_build_task.called

          assert not self.jg.process_action.called

  

-     @mock.patch("backend.daemons.job_grab.get")

+     @mock.patch("copr_backend.daemons.job_grab.get")

      def test_load_tasks_error_request_json(self, mc_get, init_jg):

          mc_get.return_value.json.side_effect = ValueError()

  
@@ -210,7 +210,7 @@

          assert not self.jg.route_build_task.called

          assert not self.jg.process_action.called

  

-     @mock.patch("backend.daemons.job_grab.get")

+     @mock.patch("copr_backend.daemons.job_grab.get")

      def test_load_tasks_builds(self, mc_get, init_jg):

          mc_get.return_value.json.return_value = {

              "builds": [
@@ -234,7 +234,7 @@

          assert len(self.jg.route_build_task.call_args_list) == 3

          assert not self.jg.process_action.called

  

-     @mock.patch("backend.daemons.job_grab.get")

+     @mock.patch("copr_backend.daemons.job_grab.get")

      def test_load_tasks_actions(self, mc_get, init_jg):

          action_1 = MagicMock()

          action_2 = MagicMock()
@@ -255,7 +255,7 @@

          expected_calls = [call(action_1), call(action_2)]

          assert self.jg.process_action.call_args_list == expected_calls

  

-     @mock.patch("backend.daemons.job_grab.get")

+     @mock.patch("copr_backend.daemons.job_grab.get")

      def test_regression_load_tasks_actions_(self, mc_get, init_jg):

          """

          https://bugzilla.redhat.com/show_bug.cgi?id=1182106

@@ -5,23 +5,23 @@

  from pprint import pprint

  import socket

  from munch import Munch

- from backend.exceptions import BuilderError, VmError

+ from copr_backend.exceptions import BuilderError, VmError

  

  import tempfile

  import shutil

  import os

  

- from backend.job import BuildJob

+ from copr_backend.job import BuildJob

  

  from unittest import mock, skip

  from unittest.mock import patch, MagicMock

  import pytest

  from types import MethodType

  

- import backend.mockremote.builder as builder_module

- from backend.mockremote.builder import Builder

+ import copr_backend.mockremote.builder as builder_module

+ from copr_backend.mockremote.builder import Builder

  

- MODULE_REF = "backend.mockremote.builder"

+ MODULE_REF = "copr_backend.mockremote.builder"

  

  # TODO: drop these, these are not needed

  class BuilderTimeOutError(Exception):
@@ -501,7 +501,7 @@

          assert builder.conn.module_args == expected

  

      @skip("Fixme or remove, test doesn't work.")

-     @mock.patch("backend.mockremote.builder.check_for_ans_error")

+     @mock.patch("copr_backend.mockremote.builder.check_for_ans_error")

      def test_run_ansible_with_check(self, mc_check_for_ans_errror):

          builder = self.get_test_builder()

  
@@ -539,7 +539,7 @@

  

  

      @skip("Fixme or remove, test doesn't work.")

-     @mock.patch("backend.mockremote.builder.check_for_ans_error")

+     @mock.patch("copr_backend.mockremote.builder.check_for_ans_error")

      def test_check_build_success(self, mc_check_for_ans_errror):

          builder = self.get_test_builder()

  
@@ -553,7 +553,7 @@

          assert expected_ans_args == builder.conn.module_args

  

      @skip("Fixme or remove, test doesn't work.")

-     @mock.patch("backend.mockremote.builder.check_for_ans_error")

+     @mock.patch("copr_backend.mockremote.builder.check_for_ans_error")

      def test_check_build_exception(self, mc_check_for_ans_errror):

          builder = self.get_test_builder()

  
@@ -618,7 +618,7 @@

          # assert result_cmd == expected

  

      @skip("Fixme or remove, test doesn't work.")

-     @mock.patch("backend.mockremote.builder.time")

+     @mock.patch("copr_backend.mockremote.builder.time")

      def test_run_command_and_wait_timeout(self, mc_time):

          build_cmd = "foo bar"

          builder = self.get_test_builder()
@@ -634,7 +634,7 @@

              builder.run_build_and_wait(build_cmd)

  

      @skip("Fixme or remove, test doesn't work.")

-     @mock.patch("backend.mockremote.builder.time")

+     @mock.patch("copr_backend.mockremote.builder.time")

      def test_run_command_and_wait(self, mc_time):

          build_cmd = "foo bar"

          builder = self.get_test_builder()
@@ -660,7 +660,7 @@

          builder.run_build_and_wait(build_cmd)

  

      @skip("Fixme or remove, test doesn't work.")

-     @mock.patch("backend.mockremote.builder.Popen")

+     @mock.patch("copr_backend.mockremote.builder.Popen")

      def test_download(self, mc_popen):

          builder = self.get_test_builder()

  
@@ -686,7 +686,7 @@

              # assert mc_popen.call_args[0][0] == expected_arg

  

      @skip("Fixme or remove, test doesn't work.")

-     @mock.patch("backend.mockremote.builder.Popen")

+     @mock.patch("copr_backend.mockremote.builder.Popen")

      def test_download_popen_error(self, mc_popen):

          builder = self.get_test_builder()

          mc_popen.side_effect = IOError()

@@ -3,7 +3,7 @@

  

  from collections import defaultdict

  from munch import Munch

- from backend.exceptions import MockRemoteError, CoprSignError, BuilderError

+ from copr_backend.exceptions import MockRemoteError, CoprSignError, BuilderError

  

  import tempfile

  import shutil
@@ -13,11 +13,11 @@

  from unittest.mock import patch, MagicMock

  import pytest

  

- from backend.mockremote import MockRemote

- from backend.job import BuildJob

+ from copr_backend.mockremote import MockRemote

+ from copr_backend.job import BuildJob

  

  

- MODULE_REF = "backend.mockremote"

+ MODULE_REF = "copr_backend.mockremote"

  

  STDOUT = "stdout"

  STDERR = "stderr"
@@ -30,7 +30,7 @@

  

      @pytest.yield_fixture

      def f_mock_remote(self):

-         patcher = mock.patch("backend.mockremote.Builder")

+         patcher = mock.patch("copr_backend.mockremote.Builder")

          self.mc_builder = patcher.start()

          self.mc_logger = MagicMock()

          self.mr = MockRemote(self.HOST, self.JOB, opts=self.OPTS, logger=self.mc_logger)
@@ -98,7 +98,7 @@

  

          out, err = capsys.readouterr()

  

-     @mock.patch("backend.mockremote.get_pubkey")

+     @mock.patch("copr_backend.mockremote.get_pubkey")

      def test_add_pubkey(self, mc_get_pubkey, f_mock_remote):

          self.mr.add_pubkey()

          assert mc_get_pubkey.called
@@ -106,31 +106,31 @@

          assert mc_get_pubkey.call_args == mock.call(

              COPR_OWNER, COPR_NAME, expected_path)

  

-     @mock.patch("backend.mockremote.get_pubkey")

+     @mock.patch("copr_backend.mockremote.get_pubkey")

      def test_add_pubkey_on_exception(self, mc_get_pubkey, f_mock_remote):

          mc_get_pubkey.side_effect = CoprSignError("foobar")

          # doesn't raise an error

          self.mr.add_pubkey()

  

-     @mock.patch("backend.mockremote.sign_rpms_in_dir")

+     @mock.patch("copr_backend.mockremote.sign_rpms_in_dir")

      def test_sign_built_packages(self, mc_sign_rpms_in_dir, f_mock_remote):

          self.mr.sign_built_packages()

          assert mc_sign_rpms_in_dir.called

  

-     @mock.patch("backend.mockremote.sign_rpms_in_dir")

+     @mock.patch("copr_backend.mockremote.sign_rpms_in_dir")

      def test_sign_built_packages_exception(self, mc_sign_rpms_in_dir, f_mock_remote):

          mc_sign_rpms_in_dir.side_effect = IOError()

          # doesn't raise an error

          self.mr.sign_built_packages()

  

-     @mock.patch("backend.mockremote.sign_rpms_in_dir")

+     @mock.patch("copr_backend.mockremote.sign_rpms_in_dir")

      def test_sign_built_packages_exception_reraise(self, mc_sign_rpms_in_dir, f_mock_remote):

          mc_sign_rpms_in_dir.side_effect = MockRemoteError("foobar")

          with pytest.raises(MockRemoteError):

              self.mr.sign_built_packages()

  

      @skip("Fixme or remove, test doesn't work.")

-     @mock.patch("backend.mockremote.createrepo")

+     @mock.patch("copr_backend.mockremote.createrepo")

      def test_do_createrepo(self, mc_createrepo, f_mock_remote):

          mc_createrepo.return_value = ("", "", "")

          self.mr.do_createrepo()
@@ -145,7 +145,7 @@

          assert mc_createrepo.call_args == expected_call

  

      @skip("Fixme or remove, test doesn't work.")

-     @mock.patch("backend.mockremote.createrepo")

+     @mock.patch("copr_backend.mockremote.createrepo")

      def test_do_createrepo_on_error(self, mc_createrepo, f_mock_remote):

          err_msg = "error occurred"

          mc_createrepo.return_value = ("", "", err_msg)

file modified
+21 -21
@@ -13,8 +13,8 @@

  from unittest import mock

  from unittest.mock import MagicMock

  

- from backend.actions import Action, ActionType, ActionResult

- from backend.exceptions import CreateRepoError, CoprKeygenRequestError

+ from copr_backend.actions import Action, ActionType, ActionResult

+ from copr_backend.exceptions import CreateRepoError, CoprKeygenRequestError

  from requests import RequestException

  

  from testlib.repodata import load_primary_xml
@@ -24,7 +24,7 @@

  STDERR = "stderr"

  

  

- @mock.patch("backend.actions.time")

+ @mock.patch("copr_backend.actions.time")

  class TestAction(object):

  

      def setup_method(self, method):
@@ -131,10 +131,10 @@

  

          self.dummy = str(test_action)

  

-     @mock.patch("backend.actions.copy_tree")

-     @mock.patch("backend.actions.os.path.exists")

-     @mock.patch("backend.actions.unsign_rpms_in_dir")

-     @mock.patch("backend.actions.subprocess.call")

+     @mock.patch("copr_backend.actions.copy_tree")

+     @mock.patch("copr_backend.actions.os.path.exists")

+     @mock.patch("copr_backend.actions.unsign_rpms_in_dir")

+     @mock.patch("copr_backend.actions.subprocess.call")

      def test_action_handle_forks(self, mc_call, mc_unsign_rpms_in_dir, mc_exists, mc_copy_tree, mc_time):

          mc_time.time.return_value = self.test_time

          mc_exists = True
@@ -341,8 +341,8 @@

  

          assert not os.path.exists(os.path.join(tmp_dir, "old_dir"))

  

-     @mock.patch("backend.actions.uses_devel_repo")

-     @mock.patch("backend.actions.call_copr_repo")

+     @mock.patch("copr_backend.actions.uses_devel_repo")

+     @mock.patch("copr_backend.actions.call_copr_repo")

      def test_delete_no_chroot_dirs(self, mc_call, mc_devel, mc_time):

          mc_devel.return_value = False

          mc_time.time.return_value = self.test_time
@@ -365,7 +365,7 @@

          assert len(mc_call.call_args_list) == 0

          assert result == ActionResult.FAILURE

  

-     @mock.patch("backend.actions.uses_devel_repo")

+     @mock.patch("copr_backend.actions.uses_devel_repo")

      def test_delete_build_succeeded(self, mc_devel, mc_time):

          mc_devel.return_value = False

          mc_time.time.return_value = self.test_time
@@ -409,7 +409,7 @@

          assert os.path.exists(chroot_2_dir)

  

      @pytest.mark.parametrize('devel', [False, True])

-     @mock.patch("backend.actions.uses_devel_repo")

+     @mock.patch("copr_backend.actions.uses_devel_repo")

      def test_delete_build_acr_reflected(self, mc_devel, mc_time, devel):

          """

          When build is deleted, we want to remove it from both devel and normal
@@ -475,8 +475,8 @@

              assert new_primary['names'] == set(['prunerepo'])

              assert len(new_primary_devel['names']) == 3

  

-     @mock.patch("backend.actions.call_copr_repo")

-     @mock.patch("backend.actions.uses_devel_repo")

+     @mock.patch("copr_backend.actions.call_copr_repo")

+     @mock.patch("copr_backend.actions.uses_devel_repo")

      def test_delete_build_succeeded_createrepo_error(self, mc_devel,

                                                       mc_call_repo, mc_time):

          mc_time.time.return_value = self.test_time
@@ -509,7 +509,7 @@

          # just fail

          assert test_action.run() == ActionResult.FAILURE

  

-     @mock.patch("backend.actions.uses_devel_repo")

+     @mock.patch("copr_backend.actions.uses_devel_repo")

      def test_delete_two_chroots(self, mc_devel, mc_time):

          """

          Regression test, https://bugzilla.redhat.com/show_bug.cgi?id=1171796
@@ -575,7 +575,7 @@

          assert os.path.exists(chroot_20_path)

          assert os.path.exists(chroot_21_path)

  

-     @mock.patch("backend.actions.uses_devel_repo")

+     @mock.patch("copr_backend.actions.uses_devel_repo")

      def test_delete_two_chroots_two_remain(self, mc_devel, mc_time):

          """

          Regression test, https://bugzilla.redhat.com/show_bug.cgi?id=1171796
@@ -688,7 +688,7 @@

          assert os.path.exists(chroot_20_path)

          assert os.path.exists(chroot_21_path)

  

-     @mock.patch("backend.actions.uses_devel_repo")

+     @mock.patch("copr_backend.actions.uses_devel_repo")

      def test_delete_multiple_builds_succeeded(self, mc_build_devel, mc_time):

          mc_time.time.return_value = self.test_time

          mc_build_devel.return_value = False
@@ -737,8 +737,8 @@

      # We want to test that ACR flag doesn't make any difference here, explicit

      # createrepo always works with non-devel directory.

      @pytest.mark.parametrize('devel', [False, True])

-     @mock.patch("backend.actions.subprocess.call")

-     @mock.patch("backend.actions.uses_devel_repo")

+     @mock.patch("copr_backend.actions.subprocess.call")

+     @mock.patch("copr_backend.actions.uses_devel_repo")

      def test_handle_createrepo_ok(self, mc_devel, mc_sp_call, mc_time, devel):

          mc_sp_call.return_value = 0 # exit_status=0

          mc_devel.return_value = devel
@@ -771,8 +771,8 @@

  

          assert len(mc_sp_call.call_args_list) == 2

  

-     @mock.patch("backend.actions.call_copr_repo")

-     @mock.patch("backend.actions.uses_devel_repo")

+     @mock.patch("copr_backend.actions.call_copr_repo")

+     @mock.patch("copr_backend.actions.uses_devel_repo")

      def test_handle_createrepo_failure_1(self, mc_devel, mc_call, mc_time):

          tmp_dir = self.make_temp_dir()

          mc_call.return_value = 0 # failure
@@ -795,7 +795,7 @@

          assert test_action.run() == ActionResult.FAILURE

  

      @unittest.skip("Fixme, test doesn't work.")

-     @mock.patch("backend.actions.create_user_keys")

+     @mock.patch("copr_backend.actions.create_user_keys")

      def test_handle_generate_gpg_key(self, mc_cuk, mc_time):

          uname = "foo"

          pname = "bar"

@@ -9,12 +9,12 @@

  from unittest import mock

  from unittest.mock import MagicMock

  

- from backend.createrepo import createrepo, createrepo_unsafe, add_appdata, run_cmd_unsafe

- from backend.exceptions import CreateRepoError

+ from copr_backend.createrepo import createrepo, createrepo_unsafe, add_appdata, run_cmd_unsafe

+ from copr_backend.exceptions import CreateRepoError

  

- @mock.patch('backend.createrepo.createrepo_unsafe')

- @mock.patch('backend.createrepo.add_appdata')

- @mock.patch('backend.helpers.CoprClient')

+ @mock.patch('copr_backend.createrepo.createrepo_unsafe')

+ @mock.patch('copr_backend.createrepo.add_appdata')

+ @mock.patch('copr_backend.helpers.CoprClient')

  def test_createrepo_conditional_true(mc_client, mc_add_appdata, mc_create_unsafe):

      mc_client.return_value.get_project_details.return_value = MagicMock(data={"detail": {}})

      mc_create_unsafe.return_value = ""
@@ -31,8 +31,8 @@

      mc_create_unsafe.reset_mock()

  

  

- @mock.patch('backend.createrepo.createrepo_unsafe')

- @mock.patch('backend.helpers.CoprClient')

+ @mock.patch('copr_backend.createrepo.createrepo_unsafe')

+ @mock.patch('copr_backend.helpers.CoprClient')

  def test_createrepo_conditional_false(mc_client, mc_create_unsafe):

      mc_client.return_value.get_project_details.return_value = MagicMock(data={"detail": {"auto_createrepo": False}})

  
@@ -44,13 +44,13 @@

  

  @pytest.yield_fixture

  def mc_popen():

-     with mock.patch('backend.createrepo.Popen') as handle:

+     with mock.patch('copr_backend.createrepo.Popen') as handle:

          yield handle

  

  

  @pytest.yield_fixture

  def mc_run_cmd_unsafe():

-     with mock.patch('backend.createrepo.run_cmd_unsafe') as handle:

+     with mock.patch('copr_backend.createrepo.run_cmd_unsafe') as handle:

          yield handle

  

  

@@ -5,9 +5,9 @@

  from munch import Munch

  from requests import RequestException, Response

  

- from backend.frontend import (FrontendClient, FrontendClientRetryError,

+ from copr_backend.frontend import (FrontendClient, FrontendClientRetryError,

                                SLEEP_INCREMENT_TIME)

- from backend.exceptions import FrontendClientException

+ from copr_backend.exceptions import FrontendClientException

  

  from unittest import mock

  from unittest.mock import MagicMock
@@ -15,19 +15,19 @@

  

  @pytest.yield_fixture

  def post_req():

-     with mock.patch("backend.frontend.post") as obj:

+     with mock.patch("copr_backend.frontend.post") as obj:

          yield obj

  

  @pytest.fixture(scope='function', params=['get', 'post', 'put'])

  def f_request_method(request):

      'mock the requests.{get,post,put} method'

-     with mock.patch("backend.frontend.{}".format(request.param)) as ctx:

+     with mock.patch("copr_backend.frontend.{}".format(request.param)) as ctx:

          yield (request.param, ctx)

  

  

  @pytest.yield_fixture

  def mc_time():

-     with mock.patch("backend.frontend.time") as obj:

+     with mock.patch("copr_backend.frontend.time") as obj:

          yield obj

  

  
@@ -127,7 +127,7 @@

              assert self.fc._post_to_frontend_repeatedly(self.data, self.url_path) == response

          assert mc_time.sleep.called

  

-     @mock.patch('backend.frontend.BACKEND_TIMEOUT', 100)

+     @mock.patch('copr_backend.frontend.BACKEND_TIMEOUT', 100)

      def test_post_to_frontend_repeated_all_attempts_failed(self,

              mask_frontend_request, caplog, mc_time):

          mc_time.time.side_effect = [0, 0, 5, 5+10, 5+10+15, 5+10+15+20, 1000]

@@ -4,16 +4,16 @@

  import json

  import logging

  

- from backend.exceptions import BuilderError

- from backend.helpers import get_redis_logger, get_chroot_arch, \

+ from copr_backend.exceptions import BuilderError

+ from copr_backend.helpers import get_redis_logger, get_chroot_arch, \

          format_filename, get_redis_connection

- from backend.constants import LOG_REDIS_FIFO

+ from copr_backend.constants import LOG_REDIS_FIFO

  

  """

  SOME TESTS REQUIRES RUNNING REDIS

  """

  

- MODULE_REF = "backend.helpers"

+ MODULE_REF = "copr_backend.helpers"

  

  

  class TestHelpers(object):
@@ -32,7 +32,7 @@

          pass

  

      def test_redis_logger_exception(self):

-         log = get_redis_logger(self.opts, "backend.test", "test")

+         log = get_redis_logger(self.opts, "copr_backend.test", "test")

          try:

              raise BuilderError("foobar")

          except Exception as err:
@@ -42,7 +42,7 @@

          data = json.loads(raw_message)

          assert data.get("who") == "test"

          assert data.get("levelno") == logging.ERROR

-         assert 'backend.exceptions.BuilderError: foobar\n' in data['msg']

+         assert 'copr_backend.exceptions.BuilderError: foobar\n' in data['msg']

  

      def test_get_chroot_arch(self):

          assert get_chroot_arch("fedora-26-x86_64") == "x86_64"

@@ -7,7 +7,7 @@

  import shutil

  import subprocess

  import tempfile

- from backend.helpers import call_copr_repo

+ from copr_backend.helpers import call_copr_repo

  from testlib.repodata import load_primary_xml

  

  modifyrepo = 'run/copr-repo'
@@ -113,7 +113,7 @@

          _, err = capfd.readouterr()

          assert 'copr-repo: error: argument' in err

  

-     @mock.patch("backend.helpers.subprocess.call")

+     @mock.patch("copr_backend.helpers.subprocess.call")

      def test_copr_repo_subdir_none_doesnt_raise(self, call):

          """ check that None is skipped in add (or delete) """

          call.return_value = 0 # exit status 0

file modified
+31 -31
@@ -6,12 +6,12 @@

  from munch import Munch

  import pytest

  

- from backend.exceptions import CoprSignError, CoprSignNoKeyError, CoprKeygenRequestError

+ from copr_backend.exceptions import CoprSignError, CoprSignNoKeyError, CoprKeygenRequestError

  

  from unittest import mock

  from unittest.mock import MagicMock

  

- from backend.sign import get_pubkey, _sign_one, sign_rpms_in_dir, create_user_keys

+ from copr_backend.sign import get_pubkey, _sign_one, sign_rpms_in_dir, create_user_keys

  

  

  STDOUT = "stdout"
@@ -49,7 +49,7 @@

              with open(path, "w") as handle:

                  handle.write("1")

  

-     @mock.patch("backend.sign.Popen")

+     @mock.patch("copr_backend.sign.Popen")

      def test_get_pubkey(self, mc_popen):

          mc_handle = MagicMock()

          mc_handle.communicate.return_value = (STDOUT, STDERR)
@@ -61,7 +61,7 @@

          assert mc_popen.call_args[0][0] == ['/bin/sign', '-u', self.usermail, '-p']

  

  

-     @mock.patch("backend.sign.Popen")

+     @mock.patch("copr_backend.sign.Popen")

      def test_get_pubkey_error(self, mc_popen):

          mc_popen.side_effect = IOError(STDERR)

  
@@ -69,7 +69,7 @@

              get_pubkey(self.username, self.projectname)

  

  

-     @mock.patch("backend.sign.Popen")

+     @mock.patch("copr_backend.sign.Popen")

      def test_get_pubkey_unknown_key(self, mc_popen):

          mc_handle = MagicMock()

          mc_handle.communicate.return_value = (STDOUT, "unknown key: foobar")
@@ -81,7 +81,7 @@

  

          assert "There are no gpg keys for user foo in keyring" in str(err)

  

-     @mock.patch("backend.sign.Popen")

+     @mock.patch("copr_backend.sign.Popen")

      def test_get_pubkey_unknown_error(self, mc_popen):

          mc_handle = MagicMock()

          mc_handle.communicate.return_value = (STDOUT, STDERR)
@@ -93,7 +93,7 @@

  

          assert "Failed to get user pubkey" in str(err)

  

-     @mock.patch("backend.sign.Popen")

+     @mock.patch("copr_backend.sign.Popen")

      def test_get_pubkey_outfile(self, mc_popen, tmp_dir):

          mc_handle = MagicMock()

          mc_handle.communicate.return_value = (STDOUT, STDERR)
@@ -109,7 +109,7 @@

              content = handle.read()

              assert STDOUT == content

  

-     @mock.patch("backend.sign.Popen")

+     @mock.patch("copr_backend.sign.Popen")

      def test_sign_one(self, mc_popen):

          mc_handle = MagicMock()

          mc_handle.communicate.return_value = (STDOUT, STDERR)
@@ -123,7 +123,7 @@

          expected_cmd = ['/bin/sign', '-u', self.usermail, '-r', fake_path]

          assert mc_popen.call_args[0][0] == expected_cmd

  

-     @mock.patch("backend.sign.Popen")

+     @mock.patch("copr_backend.sign.Popen")

      def test_sign_one_popen_error(self, mc_popen):

          mc_popen.side_effect = IOError()

  
@@ -131,7 +131,7 @@

          with pytest.raises(CoprSignError):

              _sign_one(fake_path, self.usermail)

  

-     @mock.patch("backend.sign.Popen")

+     @mock.patch("copr_backend.sign.Popen")

      def test_sign_one_cmd_erro(self, mc_popen):

          mc_handle = MagicMock()

          mc_handle.communicate.return_value = (STDOUT, STDERR)
@@ -142,7 +142,7 @@

          with pytest.raises(CoprSignError):

              _sign_one(fake_path, self.usermail)

  

-     @mock.patch("backend.sign.request")

+     @mock.patch("copr_backend.sign.request")

      def test_create_user_keys(self, mc_request):

          mc_request.return_value.status_code = 200

          create_user_keys(self.username, self.projectname, self.opts)
@@ -155,7 +155,7 @@

          )

          assert mc_request.call_args == expected_call

  

-     @mock.patch("backend.sign.request")

+     @mock.patch("copr_backend.sign.request")

      def test_create_user_keys_error_1(self, mc_request):

          mc_request.side_effect = IOError()

          with pytest.raises(CoprKeygenRequestError) as err:
@@ -164,7 +164,7 @@

          assert "Failed to create key-pair" in str(err)

  

  

-     @mock.patch("backend.sign.request")

+     @mock.patch("copr_backend.sign.request")

      def test_create_user_keys(self, mc_request):

          for code in [400, 401, 404, 500, 599]:

              mc_request.return_value.status_code = code
@@ -174,9 +174,9 @@

                  create_user_keys(self.username, self.projectname, self.opts)

              assert "Failed to create key-pair for user: foo, project:bar" in str(err)

  

-     @mock.patch("backend.sign._sign_one")

-     @mock.patch("backend.sign.create_user_keys")

-     @mock.patch("backend.sign.get_pubkey")

+     @mock.patch("copr_backend.sign._sign_one")

+     @mock.patch("copr_backend.sign.create_user_keys")

+     @mock.patch("copr_backend.sign.get_pubkey")

      def test_sign_rpms_id_dir_nothing(self, mc_gp, mc_cuk, mc_so,

                                        tmp_dir):

          # empty target dir doesn't produce error
@@ -187,9 +187,9 @@

          assert not mc_cuk.called

          assert not mc_so.called

  

-     @mock.patch("backend.sign._sign_one")

-     @mock.patch("backend.sign.create_user_keys")

-     @mock.patch("backend.sign.get_pubkey")

+     @mock.patch("copr_backend.sign._sign_one")

+     @mock.patch("copr_backend.sign.create_user_keys")

+     @mock.patch("copr_backend.sign.get_pubkey")

      def test_sign_rpms_id_dir_ok(self, mc_gp, mc_cuk, mc_so,

                                        tmp_dir, tmp_files):

  
@@ -208,9 +208,9 @@

                  assert os.path.join(self.tmp_dir_path, name) in pathes

          assert len(pathes) == count

  

-     @mock.patch("backend.sign._sign_one")

-     @mock.patch("backend.sign.create_user_keys")

-     @mock.patch("backend.sign.get_pubkey")

+     @mock.patch("copr_backend.sign._sign_one")

+     @mock.patch("copr_backend.sign.create_user_keys")

+     @mock.patch("copr_backend.sign.get_pubkey")

      def test_sign_rpms_id_dir_error_on_pubkey(

              self, mc_gp, mc_cuk, mc_so, tmp_dir, tmp_files):

  
@@ -223,9 +223,9 @@

          assert not mc_cuk.called

          assert not mc_so.called

  

-     @mock.patch("backend.sign._sign_one")

-     @mock.patch("backend.sign.create_user_keys")

-     @mock.patch("backend.sign.get_pubkey")

+     @mock.patch("copr_backend.sign._sign_one")

+     @mock.patch("copr_backend.sign.create_user_keys")

+     @mock.patch("copr_backend.sign.get_pubkey")

      def test_sign_rpms_id_dir_no_pub_key(

              self, mc_gp, mc_cuk, mc_so, tmp_dir, tmp_files):

  
@@ -238,9 +238,9 @@

          assert mc_cuk.called

          assert mc_so.called

  

-     @mock.patch("backend.sign._sign_one")

-     @mock.patch("backend.sign.create_user_keys")

-     @mock.patch("backend.sign.get_pubkey")

+     @mock.patch("copr_backend.sign._sign_one")

+     @mock.patch("copr_backend.sign.create_user_keys")

+     @mock.patch("copr_backend.sign.get_pubkey")

      def test_sign_rpms_id_dir_sign_error_one(

              self, mc_gp, mc_cuk, mc_so, tmp_dir, tmp_files):

  
@@ -256,9 +256,9 @@

  

          assert mc_so.called

  

-     @mock.patch("backend.sign._sign_one")

-     @mock.patch("backend.sign.create_user_keys")

-     @mock.patch("backend.sign.get_pubkey")

+     @mock.patch("copr_backend.sign._sign_one")

+     @mock.patch("copr_backend.sign.create_user_keys")

+     @mock.patch("copr_backend.sign.get_pubkey")

      def test_sign_rpms_id_dir_sign_error_all(

              self, mc_gp, mc_cuk, mc_so, tmp_dir, tmp_files):

  

@@ -11,9 +11,9 @@

  

  WORKDIR = os.path.dirname(__file__)

  

- from backend.helpers import get_redis_connection

- from backend.actions import ActionWorkerManager, ActionQueueTask

- from backend.worker_manager import JobQueue

+ from copr_backend.helpers import get_redis_connection

+ from copr_backend.actions import ActionWorkerManager, ActionQueueTask

+ from copr_backend.worker_manager import JobQueue

  

  REDIS_OPTS = Munch(

      redis_db=9,
@@ -172,7 +172,7 @@

                  return params

          return params

  

-     @patch('backend.worker_manager.time.time')

+     @patch('copr_backend.worker_manager.time.time')

      def test_delete_not_finished_workers(self, mc_time):

          self.worker_manager.environ = {'FAIL_STARTED': '1'}

          self.worker_manager.worker_timeout_deadcheck = 0.4
@@ -181,7 +181,7 @@

          mc_time.side_effect = range(1000)

  

          # first loop just starts the toy:0 worker

-         with patch('backend.worker_manager.time.sleep'):

+         with patch('copr_backend.worker_manager.time.sleep'):

              self.worker_manager.run(timeout=1)

  

          params = self.wait_field(self.w0, 'started')
@@ -189,12 +189,12 @@

          assert 'started' in params

  

          # toy 0 is marked for deleting

-         with patch('backend.worker_manager.time.sleep'):

+         with patch('copr_backend.worker_manager.time.sleep'):

              self.worker_manager.run(timeout=1)

          assert 'delete' in self.redis.hgetall(self.w0)

  

          # toy 0 should be deleted

-         with patch('backend.worker_manager.time.sleep'):

+         with patch('copr_backend.worker_manager.time.sleep'):

              self.worker_manager.run(timeout=1)

          keys = self.workers()

          assert self.w1 in keys
@@ -227,7 +227,7 @@

          # start the worker

          self.worker_manager.run(timeout=0.0001) # start them task

  

-         with patch('backend.worker_manager.time.sleep') as sleep:

+         with patch('copr_backend.worker_manager.time.sleep') as sleep:

              # we can spawn more workers, but queue is empty

              self.worker_manager.run(timeout=0.0001)

              assert sleep.called
@@ -237,7 +237,7 @@

          self.wait_field(self.w0, 'status')

  

          # check that we don't sleep here (no worker, no task)

-         with patch('backend.worker_manager.time.sleep') as sleep:

+         with patch('copr_backend.worker_manager.time.sleep') as sleep:

              self.worker_manager.run(timeout=0.0001)

              assert not sleep.called

  

@@ -9,11 +9,11 @@

  

  from munch import Munch

  from redis import ConnectionError

- from backend.exceptions import CoprSpawnFailError

+ from copr_backend.exceptions import CoprSpawnFailError

  

- from backend.helpers import get_redis_connection

- from backend.vm_manage import EventTopics, PUBSUB_MB

- from backend.vm_manage.check import HealthChecker, check_health

+ from copr_backend.helpers import get_redis_connection

+ from copr_backend.vm_manage import EventTopics, PUBSUB_MB

+ from copr_backend.vm_manage.check import HealthChecker, check_health

  

  from unittest import mock, skip

  from unittest.mock import MagicMock
@@ -25,7 +25,7 @@

  TODO: look if https://github.com/locationlabs/mockredis can be used

  """

  

- MODULE_REF = "backend.vm_manage.check"

+ MODULE_REF = "copr_backend.vm_manage.check"

  

  @pytest.yield_fixture

  def mc_time():

@@ -9,11 +9,11 @@

  from munch import Munch

  from redis.client import Script

  

- from backend.exceptions import VmDescriptorNotFound

- from backend.helpers import get_redis_connection

- from backend.vm_manage import VmStates

- from backend.vm_manage.event_handle import EventHandler, Recycle

- from backend.vm_manage.models import VmDescriptor

+ from copr_backend.exceptions import VmDescriptorNotFound

+ from copr_backend.helpers import get_redis_connection

+ from copr_backend.vm_manage import VmStates

+ from copr_backend.vm_manage.event_handle import EventHandler, Recycle

+ from copr_backend.vm_manage.models import VmDescriptor

  

  from unittest import mock, skip

  from unittest.mock import MagicMock
@@ -25,7 +25,7 @@

  TODO: look if https://github.com/locationlabs/mockredis can be used

  """

  

- MODULE_REF = "backend.vm_manage.event_handle"

+ MODULE_REF = "copr_backend.vm_manage.event_handle"

  

  @pytest.yield_fixture

  def mc_time():

@@ -6,8 +6,8 @@

  from munch import Munch

  import time

  

- from backend.helpers import get_redis_connection

- from backend.vm_manage.executor import Executor

+ from copr_backend.helpers import get_redis_connection

+ from copr_backend.vm_manage.executor import Executor

  

  from unittest import mock

  import pytest
@@ -18,7 +18,7 @@

  TODO: look if https://github.com/locationlabs/mockredis can be used

  """

  

- MODULE_REF = "backend.vm_manage.executor"

+ MODULE_REF = "copr_backend.vm_manage.executor"

  

  @pytest.yield_fixture

  def mc_time():

@@ -8,12 +8,12 @@

  

  from munch import Munch

  

- from backend import exceptions

- from backend.exceptions import VmError, NoVmAvailable

- from backend.vm_manage import VmStates, KEY_VM_POOL, PUBSUB_MB, EventTopics, KEY_SERVER_INFO

- from backend.vm_manage.manager import VmManager

- from backend.daemons.vm_master import VmMaster

- from backend.helpers import get_redis_connection

+ from copr_backend import exceptions

+ from copr_backend.exceptions import VmError, NoVmAvailable

+ from copr_backend.vm_manage import VmStates, KEY_VM_POOL, PUBSUB_MB, EventTopics, KEY_SERVER_INFO

+ from copr_backend.vm_manage.manager import VmManager

+ from copr_backend.daemons.vm_master import VmMaster

+ from copr_backend.helpers import get_redis_connection

  

  from  unittest import mock

  from unittest.mock import MagicMock
@@ -25,7 +25,7 @@

  TODO: look if https://github.com/locationlabs/mockredis can be used

  """

  

- MODULE_REF = "backend.vm_manage.manager"

+ MODULE_REF = "copr_backend.vm_manage.manager"

  

  @pytest.yield_fixture

  def mc_time():

@@ -7,10 +7,10 @@

  

  from munch import Munch

  from redis import ConnectionError

- from backend.exceptions import CoprSpawnFailError

+ from copr_backend.exceptions import CoprSpawnFailError

  

- from backend.helpers import get_redis_connection

- from backend.vm_manage.spawn import Spawner, spawn_instance, do_spawn_and_publish

+ from copr_backend.helpers import get_redis_connection

+ from copr_backend.vm_manage.spawn import Spawner, spawn_instance, do_spawn_and_publish

  

  from unittest import mock, skip

  from unittest.mock import MagicMock
@@ -22,7 +22,7 @@

  TODO: look if https://github.com/locationlabs/mockredis can be used

  """

  

- MODULE_REF = "backend.vm_manage.spawn"

+ MODULE_REF = "copr_backend.vm_manage.spawn"

  

  @pytest.yield_fixture

  def mc_time():

@@ -8,11 +8,11 @@

  

  from munch import Munch

  from redis import ConnectionError

- from backend.exceptions import CoprSpawnFailError

+ from copr_backend.exceptions import CoprSpawnFailError

  

- from backend.helpers import get_redis_connection

- from backend.vm_manage import EventTopics

- from backend.vm_manage.terminate import Terminator, terminate_vm

+ from copr_backend.helpers import get_redis_connection

+ from copr_backend.vm_manage import EventTopics

+ from copr_backend.vm_manage.terminate import Terminator, terminate_vm

  

  from unittest import mock, skip

  from unittest.mock import MagicMock
@@ -24,7 +24,7 @@

  TODO: look if https://github.com/locationlabs/mockredis can be used

  """

  

- MODULE_REF = "backend.vm_manage.terminate"

+ MODULE_REF = "copr_backend.vm_manage.terminate"

  

  @pytest.yield_fixture

  def mc_time():

@@ -6,7 +6,6 @@

  

  [Service]

  Type=simple

- Environment="PYTHONPATH=/usr/share/copr/"

  User=copr

  Group=copr

  ExecStart=/usr/bin/copr_run_action_dispatcher.py

@@ -6,7 +6,6 @@

  

  [Service]

  Type=simple

- Environment="PYTHONPATH=/usr/share/copr/"

  User=copr

  Group=copr

  ExecStart=/usr/bin/copr_run_build_dispatcher.py

@@ -8,7 +8,6 @@

  

  [Service]

  Type=simple

- Environment="PYTHONPATH=/usr/share/copr/"

  User=copr

  Group=copr

  ExecStart=/usr/bin/copr_run_logger.py

@@ -6,7 +6,6 @@

  

  [Service]

  Type=simple

- Environment="PYTHONPATH=/usr/share/copr/"

  User=copr

  Group=copr

  ExecStart=/usr/bin/copr_run_vmm.py

@@ -11,7 +11,6 @@

  Type=oneshot

  RemainAfterExit=True

  PIDFile=/var/run/copr-backend/copr-be.pid

- Environment="PYTHONPATH=/usr/share/copr/"

  User=copr

  Group=copr

  ExecStart=/usr/bin/copr_be.py

Note that this is by far not complete commit WRT PyPI (and friends).

I don't plan to move stuff like unit files, and other configuration to the
setup.py (at least not ATM). I just moved the necessary stuff to
%python_sitelib to make the spec file more python-standard, and especially
to fix things so we no more have to edit the path in each executable.

pretty please pagure-ci rebuild

3 years ago

pretty please pagure-ci rebuild

3 years ago

pretty please pagure-ci rebuild

3 years ago

Ah, I can already feel the pain rebasing all the opened pull requests :D.

But yea, definitely +1. This should have been done a long time ago.

Ah, I can already feel the pain rebasing all the opened pull requests :D

So no problem with merging this one first? That's my preference (even though
I have some other submitted PRs, too...). But I'm rather asking once more.

Well, I don't see the rebase work that hard here, git mergetool is my friend.

So no problem with merging this one first? That's my preference (even though
I have some other submitted PRs, too...).

No problem, same here.

Commit 0fc780a fixes this pull-request

Pull-Request has been merged by praiskup

3 years ago
Changes Summary 78
+0 -1
file changed
backend/copr-backend.service
+6 -7
file changed
backend/copr-backend.spec
+0 -0
file renamed
backend/backend/__init__.py
backend/copr_backend/__init__.py
+2 -2
file renamed
backend/backend/actions.py
backend/copr_backend/actions.py
+0 -0
file renamed
backend/backend/ans_utils.py
backend/copr_backend/ans_utils.py
+0 -0
file renamed
backend/backend/constants.py
backend/copr_backend/constants.py
+1 -1
file renamed
backend/backend/createrepo.py
backend/copr_backend/createrepo.py
+0 -0
file renamed
backend/backend/daemons/__init__.py
backend/copr_backend/daemons/__init__.py
+2 -2
file renamed
backend/backend/daemons/action_dispatcher.py
backend/copr_backend/daemons/action_dispatcher.py
+1 -1
file renamed
backend/backend/daemons/backend.py
backend/copr_backend/daemons/backend.py
+1 -2
file renamed
backend/backend/daemons/build_dispatcher.py
backend/copr_backend/daemons/build_dispatcher.py
+0 -0
file renamed
backend/backend/daemons/log.py
backend/copr_backend/daemons/log.py
+0 -0
file renamed
backend/backend/daemons/vm_master.py
backend/copr_backend/daemons/vm_master.py
+0 -0
file renamed
backend/backend/daemons/worker.py
backend/copr_backend/daemons/worker.py
+0 -0
file renamed
backend/backend/exceptions.py
backend/copr_backend/exceptions.py
+1 -1
file renamed
backend/backend/frontend.py
backend/copr_backend/frontend.py
+2 -2
file renamed
backend/backend/helpers.py
backend/copr_backend/helpers.py
+1 -1
file renamed
backend/backend/job.py
backend/copr_backend/job.py
+0 -0
file renamed
backend/backend/mockremote/__init__.py
backend/copr_backend/mockremote/__init__.py
+1 -1
file renamed
backend/backend/mockremote/builder.py
backend/copr_backend/mockremote/builder.py
+0 -0
file renamed
backend/backend/msgbus.py
backend/copr_backend/msgbus.py
+0 -0
file renamed
backend/backend/sign.py
backend/copr_backend/sign.py
+0 -0
file renamed
backend/backend/sshcmd.py
backend/copr_backend/sshcmd.py
+0 -0
file renamed
backend/backend/vm_manage/__init__.py
backend/copr_backend/vm_manage/__init__.py
+4 -4
file renamed
backend/backend/vm_manage/check.py
backend/copr_backend/vm_manage/check.py
+3 -3
file renamed
backend/backend/vm_manage/event_handle.py
backend/copr_backend/vm_manage/event_handle.py
+0 -0
file renamed
backend/backend/vm_manage/executor.py
backend/copr_backend/vm_manage/executor.py
+2 -2
file renamed
backend/backend/vm_manage/manager.py
backend/copr_backend/vm_manage/manager.py
+1 -1
file renamed
backend/backend/vm_manage/models.py
backend/copr_backend/vm_manage/models.py
+3 -3
file renamed
backend/backend/vm_manage/spawn.py
backend/copr_backend/vm_manage/spawn.py
+5 -5
file renamed
backend/backend/vm_manage/terminate.py
backend/copr_backend/vm_manage/terminate.py
+0 -0
file renamed
backend/backend/worker_manager.py
backend/copr_backend/worker_manager.py
+0 -5
file changed
backend/docker/files/etc/supervisord.conf
+2 -7
file changed
backend/run/check_consecutive_build_fails.py
+4 -7
file changed
backend/run/cleanup_vm_nova.py
+3 -6
file changed
backend/run/copr-backend-process-action
+1 -3
file changed
backend/run/copr-repo
+1 -1
file changed
backend/run/copr_be.py
+2 -4
file changed
backend/run/copr_createrepo.py
+3 -6
file changed
backend/run/copr_fix_gpg.py
+2 -6
file changed
backend/run/copr_get_vm_info.py
+1 -3
file changed
backend/run/copr_log_hitcounter.py
+2 -3
file changed
backend/run/copr_print_results_to_delete.py
+4 -6
file changed
backend/run/copr_prune_results.py
+4 -2
file changed
backend/run/copr_run_action_dispatcher.py
+4 -2
file changed
backend/run/copr_run_build_dispatcher.py
+2 -2
file changed
backend/run/copr_run_logger.py
+7 -7
file changed
backend/run/copr_run_vmm.py
+4 -8
file changed
backend/run/copr_sign_unsigned.py
+2 -3
file changed
backend/run/print_queues.py
+29
file added
backend/setup.py
+1 -1
file changed
backend/tests/action-processor.py
+1 -1
file changed
backend/tests/conftest.py
+8 -8
file changed
backend/tests/daemons/test_backend.py
+9 -9
file changed
backend/tests/daemons/test_dispatcher.py
+5 -6
file changed
backend/tests/daemons/test_log.py
+7 -7
file changed
backend/tests/daemons/test_vm_master.py
+10 -10
file changed
backend/tests/daemons/unused_test_job_grab.py
+12 -12
file changed
backend/tests/mockremote/test_builder.py
+12 -12
file changed
backend/tests/mockremote/test_mockremote.py
+21 -21
file changed
backend/tests/test_action.py
+9 -9
file changed
backend/tests/test_createrepo.py
+6 -6
file changed
backend/tests/test_frontend.py
+6 -6
file changed
backend/tests/test_helpers.py
+2 -2
file changed
backend/tests/test_modifyrepo.py
+31 -31
file changed
backend/tests/test_sign.py
+9 -9
file changed
backend/tests/test_worker_manager.py
+5 -5
file changed
backend/tests/vm_manager/test_check.py
+6 -6
file changed
backend/tests/vm_manager/test_event_handle.py
+3 -3
file changed
backend/tests/vm_manager/test_executor.py
+7 -7
file changed
backend/tests/vm_manager/test_manager.py
+4 -4
file changed
backend/tests/vm_manager/test_spawn.py
+5 -5
file changed
backend/tests/vm_manager/test_terminate.py
+0 -1
file changed
backend/units/copr-backend-action.service
+0 -1
file changed
backend/units/copr-backend-build.service
+0 -1
file changed
backend/units/copr-backend-log.service
+0 -1
file changed
backend/units/copr-backend-vmm.service
+0 -1
file changed
backend/units/copr-backend.service