[copr] master: [frontend,python,cli] control auto_createrepo property of project through API and copr-cli; new command supported by cli: **modify** (23e1127)
by vgologuz@fedoraproject.org
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 23e11273f2377830bb610780eb8c8c4bfeb271e9
Author: Valentin Gologuzov <vgologuz(a)redhat.com>
Date: Mon Dec 15 12:32:13 2014 +0100
[frontend,python,cli] control auto_createrepo property of project through API and copr-cli; new command supported by cli: **modify**
>---------------------------------------------------------------
cli/copr_cli/main.py | 27 ++++++++++++++++++++
frontend/coprs_frontend/coprs/forms.py | 2 +
.../coprs/views/api_ns/api_general.py | 12 ++++++---
.../test_views/test_api_ns/test_api_general.py | 7 +++++
python/copr/client/client.py | 8 ++++-
5 files changed, 50 insertions(+), 6 deletions(-)
diff --git a/cli/copr_cli/main.py b/cli/copr_cli/main.py
index 2ec2913..48a5be5 100644
--- a/cli/copr_cli/main.py
+++ b/cli/copr_cli/main.py
@@ -175,6 +175,19 @@ class Commands(object):
print(result.message)
@requires_api_auth
+ def action_modify_project(self, args):
+ """ Method called when the 'modify' action has been selected by the
+ user.
+
+ :param args: argparse arguments provided by the user
+ """
+
+ result = self.client.modify_project(
+ projectname=args.name,
+ description=args.description, instructions=args.instructions,
+ repos=args.repos, disable_createrepo=args.disable_createrepo)
+
+ @requires_api_auth
def action_delete(self, args):
""" Method called when the 'delete' action has been selected by the
user.
@@ -290,6 +303,20 @@ def setup_parser():
help="Instructions for the copr")
parser_create.set_defaults(func="action_create")
+ # create the parser for the "modify_project" command
+ parser_modify = subparsers.add_parser("modify", help="Modify existing copr")
+
+ parser_modify.add_argument("name", help="The name of the copr to modify")
+ parser_modify.add_argument("--description",
+ help="Description of the copr")
+ parser_modify.add_argument("--instructions",
+ help="Instructions for the copr")
+ parser_modify.add_argument("--repo", dest="repos", action="append",
+ help="Repository to add to this copr")
+ parser_modify.add_argument("--disable_createrepo",
+ help="Disable metadata auto generation")
+ parser_modify.set_defaults(func="action_modify_project")
+
# create the parser for the "delete" command
parser_delete = subparsers.add_parser("delete",
help="Deletes the entire project")
diff --git a/frontend/coprs_frontend/coprs/forms.py b/frontend/coprs_frontend/coprs/forms.py
index 241a4b2..6a644c2 100644
--- a/frontend/coprs_frontend/coprs/forms.py
+++ b/frontend/coprs_frontend/coprs/forms.py
@@ -319,6 +319,8 @@ class CoprModifyForm(wtf.Form):
wtforms.validators.Optional()],
filters=[StringListFilter()])
+ disable_createrepo = wtforms.BooleanField(validators=[wtforms.validators.Optional()])
+
class ModifyChrootForm(wtf.Form):
buildroot_pkgs = wtforms.TextField('Additional packages to be always present in minimal buildroot')
diff --git a/frontend/coprs_frontend/coprs/views/api_ns/api_general.py b/frontend/coprs_frontend/coprs/views/api_ns/api_general.py
index ceca86a..b8697b4 100644
--- a/frontend/coprs_frontend/coprs/views/api_ns/api_general.py
+++ b/frontend/coprs_frontend/coprs/views/api_ns/api_general.py
@@ -414,6 +414,8 @@ def copr_modify(username, coprname):
copr.instructions = form.instructions.data
if form.repos.raw_data and len(form.repos.raw_data):
copr.repos = form.repos.data
+ if form.disable_createrepo.raw_data and len(form.disable_createrepo.raw_data):
+ copr.disable_createrepo = form.disable_createrepo.data
try:
coprs_logic.CoprsLogic.update(flask.g.user, copr)
@@ -425,10 +427,12 @@ def copr_modify(username, coprname):
else:
db.session.commit()
- output = {'output': 'ok',
- 'description': copr.description,
- 'instructions': copr.instructions,
- 'repos': copr.repos}
+ output = {
+ 'output': 'ok',
+ 'description': copr.description,
+ 'instructions': copr.instructions,
+ 'repos': copr.repos,
+ }
httpcode = 200
jsonout = flask.jsonify(output)
diff --git a/frontend/coprs_frontend/tests/test_views/test_api_ns/test_api_general.py b/frontend/coprs_frontend/tests/test_views/test_api_ns/test_api_general.py
index f9c6cd9..c8a9622 100644
--- a/frontend/coprs_frontend/tests/test_views/test_api_ns/test_api_general.py
+++ b/frontend/coprs_frontend/tests/test_views/test_api_ns/test_api_general.py
@@ -94,3 +94,10 @@ class TestCreateCopr(CoprsTestCase):
assert copr.owner.id == self.u1.id
assert copr.description == self.description
assert copr.instructions == self.instructions
+
+ #
+ # @TransactionDecorator("u1")
+ # def test_copr_modify(self, f_users, f_mock_chroots, f_db):
+ # self.db.session.add_all([self.u1, self.mc1])
+ #
+ #
diff --git a/python/copr/client/client.py b/python/copr/client/client.py
index 8d8f70a..e7f1cec 100644
--- a/python/copr/client/client.py
+++ b/python/copr/client/client.py
@@ -203,7 +203,8 @@ class CoprClient(object):
output = json.loads(response.text)
except ValueError:
raise CoprUnknownResponseException(
- "Unknown response from the server.")
+ "Unknown response from the server. Code: {}, raw response:"
+ " \n {}".format(response.status_code, response.text))
if response.status_code != 200:
raise CoprRequestException(output["error"])
@@ -481,7 +482,8 @@ class CoprClient(object):
return response
def modify_project(self, projectname, username=None,
- description=None, instructions=None, repos=None):
+ description=None, instructions=None,
+ repos=None, disable_createrepo=None):
""" Modifies main project configuration.
Auth required.
@@ -512,6 +514,8 @@ class CoprClient(object):
data["instructions"] = instructions
if repos:
data["repos"] = repos
+ if disable_createrepo:
+ data["disable_createrepo"] = disable_createrepo
result_data = self._fetch(url, data=data, method="post")
9 years, 4 months
[copr] master: Automatic commit of package [copr-backend] release [1.51-1]. (d635601)
by vgologuz@fedoraproject.org
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit d6356011b43ec6b601ce505272f688b2b5461494
Author: Valentin Gologuzov <vgologuz(a)redhat.com>
Date: Fri Dec 12 18:31:17 2014 +0100
Automatic commit of package [copr-backend] release [1.51-1].
>---------------------------------------------------------------
backend/copr-backend.spec | 9 ++++++++-
rel-eng/packages/copr-backend | 2 +-
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/backend/copr-backend.spec b/backend/copr-backend.spec
index e245700..c866c7d 100644
--- a/backend/copr-backend.spec
+++ b/backend/copr-backend.spec
@@ -3,7 +3,7 @@
%endif
Name: copr-backend
-Version: 1.50
+Version: 1.51
Release: 1%{?dist}
Summary: Backend for Copr
@@ -202,6 +202,13 @@ useradd -r -g copr -G lighttpd -s /bin/bash -c "COPR user" copr
%exclude %{_pkgdocdir}/playbooks
%changelog
+* Fri Dec 12 2014 Valentin Gologuzov <vgologuz(a)redhat.com> 1.51-1
+- updated BuildRequires; cleanup imports
+- package sign: generate gpg usermail with special symbol
+- bugfix: when dispatcher has vm_ip it shouldn't start new VM;
+- run tests during rpm build
+- minor docstring fix
+
* Wed Dec 10 2014 Valentin Gologuzov <vgologuz(a)redhat.com> 1.50-1
- [backend] added option to control ansible ssh transport, changed by default
to `paramiko` [frontend] bugfix api create new
diff --git a/rel-eng/packages/copr-backend b/rel-eng/packages/copr-backend
index 1754c90..286123e 100644
--- a/rel-eng/packages/copr-backend
+++ b/rel-eng/packages/copr-backend
@@ -1 +1 @@
-1.50-1 backend/
+1.51-1 backend/
9 years, 4 months
[copr] master: [backend] updated BuildRequires; cleanup imports (6dd030f)
by vgologuz@fedoraproject.org
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 6dd030fa26e3faa176c31f60e104f67e98d0c8eb
Author: Valentin Gologuzov <vgologuz(a)redhat.com>
Date: Fri Dec 12 13:00:25 2014 +0100
[backend] updated BuildRequires; cleanup imports
>---------------------------------------------------------------
backend/copr-backend.spec | 12 ++++++++++++
backend/tests/deamons/test_dispatcher.py | 8 +-------
backend/tests/deamons/test_job_grab.py | 5 +----
backend/tests/deamons/test_log.py | 4 ----
backend/tests/mockremote/test_mockremote.py | 5 +----
backend/tests/test_action.py | 12 +++---------
backend/tests/test_frontend.py | 15 ++++-----------
backend/tests/test_run_copr_create_repo.py | 7 -------
backend/tests/test_sign.py | 13 ++++---------
9 files changed, 26 insertions(+), 55 deletions(-)
diff --git a/backend/copr-backend.spec b/backend/copr-backend.spec
index 6128a81..e245700 100644
--- a/backend/copr-backend.spec
+++ b/backend/copr-backend.spec
@@ -32,8 +32,19 @@ BuildRequires: python-argparse
BuildRequires: epydoc
BuildRequires: graphviz
BuildRequires: pytest
+BuildRequires: python-pytest-cov
BuildRequires: python-mock
BuildRequires: python-six
+BuildRequires: python-bunch
+BuildRequires: python-daemon
+BuildRequires: python-lockfile
+BuildRequires: python-requests
+BuildRequires: python-setproctitle
+BuildRequires: python-retask
+BuildRequires: python-copr
+BuildRequires: python-six
+BuildRequires: ansible >= 1.2
+BuildRequires: python-IPy
Requires: obs-signd
Requires: ansible >= 1.2
@@ -52,6 +63,7 @@ Requires: python-setproctitle
Requires: python-retask
Requires: python-copr
Requires: python-six
+Requires: python-IPy
Requires: redis
Requires: logrotate
Requires: fedmsg
diff --git a/backend/tests/deamons/test_dispatcher.py b/backend/tests/deamons/test_dispatcher.py
index 7f7484a..5aef710 100644
--- a/backend/tests/deamons/test_dispatcher.py
+++ b/backend/tests/deamons/test_dispatcher.py
@@ -1,22 +1,16 @@
import multiprocessing
import os
-from collections import defaultdict
-import json
-from pprint import pprint
from subprocess import CalledProcessError
-from _pytest.capture import capsys
-import ansible
+
from ansible.errors import AnsibleError
from bunch import Bunch
import pytest
-import copy
import tempfile
import shutil
import time
import six
-from retask.task import Task
from backend.constants import BuildStatus
from backend.exceptions import CoprWorkerError, CoprWorkerSpawnFailError, MockRemoteError
diff --git a/backend/tests/deamons/test_job_grab.py b/backend/tests/deamons/test_job_grab.py
index 5e85a01..a0dbe3c 100644
--- a/backend/tests/deamons/test_job_grab.py
+++ b/backend/tests/deamons/test_job_grab.py
@@ -1,14 +1,12 @@
# coding: utf-8
import copy
-from collections import defaultdict
import logging
-from pprint import pprint
from bunch import Bunch
import time
import requests
-from backend.exceptions import BuilderError, BuilderTimeOutError, CoprJobGrabError
+from backend.exceptions import CoprJobGrabError
from retask.queue import Queue
@@ -27,7 +25,6 @@ else:
import pytest
-import backend.daemons.log as log_module
from backend.daemons.job_grab import CoprJobGrab
import backend.actions
diff --git a/backend/tests/deamons/test_log.py b/backend/tests/deamons/test_log.py
index 8b4bcd9..6000686 100644
--- a/backend/tests/deamons/test_log.py
+++ b/backend/tests/deamons/test_log.py
@@ -1,12 +1,8 @@
# coding: utf-8
-import copy
-from collections import defaultdict
import logging
-from pprint import pprint
from bunch import Bunch
import time
-from backend.exceptions import BuilderError, BuilderTimeOutError
import tempfile
import shutil
diff --git a/backend/tests/mockremote/test_mockremote.py b/backend/tests/mockremote/test_mockremote.py
index 2a9ae4f..d868b02 100644
--- a/backend/tests/mockremote/test_mockremote.py
+++ b/backend/tests/mockremote/test_mockremote.py
@@ -2,9 +2,8 @@
import copy
from collections import defaultdict
-from pprint import pprint
from bunch import Bunch
-from backend.exceptions import BuilderError, BuilderTimeOutError, MockRemoteError, CoprSignError
+from backend.exceptions import MockRemoteError, CoprSignError
import tempfile
import shutil
@@ -21,8 +20,6 @@ else:
import pytest
-import backend.mockremote.builder as builder_module
-from backend.mockremote.builder import Builder
from backend.mockremote import MockRemote, get_target_dir
from backend.mockremote.callback import DefaultCallBack
from backend.job import BuildJob
diff --git a/backend/tests/test_action.py b/backend/tests/test_action.py
index 674bd10..24e1367 100644
--- a/backend/tests/test_action.py
+++ b/backend/tests/test_action.py
@@ -1,15 +1,12 @@
import os
-import argparse
-from collections import defaultdict
import json
-from pprint import pprint
-from _pytest.capture import capsys
-import pytest
import tempfile
import shutil
+import time
+import pytest
import six
-import time
+
if six.PY3:
from unittest import mock
@@ -18,8 +15,6 @@ else:
import mock
from mock import MagicMock
-import logging
-
# logging.basicConfig(
# level=logging.INFO,
# format='[%(asctime)s] {%(pathname)s:%(lineno)d} %(levelname)s - %(message)s',
@@ -31,7 +26,6 @@ import logging
from backend.actions import Action, ActionType, ActionResult
-import multiprocessing
if six.PY3:
import queue
from queue import Empty as EmptyQueue
diff --git a/backend/tests/test_frontend.py b/backend/tests/test_frontend.py
index c18d1f6..f65da0d 100644
--- a/backend/tests/test_frontend.py
+++ b/backend/tests/test_frontend.py
@@ -1,27 +1,20 @@
# coding: utf-8
-import copy
-from collections import defaultdict
-import json
import multiprocessing
-from pprint import pprint
+
from bunch import Bunch
from requests import RequestException
-from backend.exceptions import BuilderError, BuilderTimeOutError, MockRemoteError, CoprSignError
-
-import tempfile
-import shutil
-import os
-
import six
+
from backend.frontend import FrontendClient
+
if six.PY3:
from unittest import mock
from unittest.mock import patch, MagicMock
else:
import mock
- from mock import patch, MagicMock
+ from mock import MagicMock
import pytest
diff --git a/backend/tests/test_run_copr_create_repo.py b/backend/tests/test_run_copr_create_repo.py
index ea2b002..506dacd 100644
--- a/backend/tests/test_run_copr_create_repo.py
+++ b/backend/tests/test_run_copr_create_repo.py
@@ -1,13 +1,6 @@
import sys
-import os
-import argparse
-from collections import defaultdict
-import json
-from pprint import pprint
-from _pytest.capture import capsys
import pytest
-
import six
if six.PY3:
diff --git a/backend/tests/test_sign.py b/backend/tests/test_sign.py
index e396f09..59aec8c 100644
--- a/backend/tests/test_sign.py
+++ b/backend/tests/test_sign.py
@@ -1,17 +1,12 @@
import os
-
-from collections import defaultdict
-import json
-from pprint import pprint
-from _pytest.capture import capsys
-from bunch import Bunch
-import pytest
-import copy
import tempfile
import shutil
+import time
+from bunch import Bunch
+import pytest
import six
-import time
+
from backend.exceptions import CoprSignError, CoprSignNoKeyError, CoprKeygenRequestError
if six.PY3:
9 years, 4 months
[copr] master: [backend] package sign: generate gpg usermail with special symbol (3f2ae67)
by vgologuz@fedoraproject.org
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 3f2ae67712077702aaae419e6ea9cfd05406a654
Author: Valentin Gologuzov <vgologuz(a)redhat.com>
Date: Fri Dec 12 11:39:28 2014 +0100
[backend] package sign: generate gpg usermail with special symbol
>---------------------------------------------------------------
backend/tests/test_sign.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/backend/tests/test_sign.py b/backend/tests/test_sign.py
index fe9a63c..e396f09 100644
--- a/backend/tests/test_sign.py
+++ b/backend/tests/test_sign.py
@@ -34,7 +34,7 @@ class TestSign(object):
self.username = "foo"
self.projectname = "bar"
- self.usermail = "foo_bar(a)copr.fedorahosted.org"
+ self.usermail = "foo#bar(a)copr.fedorahosted.org"
self.test_time = time.time()
self.tmp_dir_path = None
9 years, 4 months
[copr] master: [backend] bugfix: when dispatcher has vm_ip it shouldn't start new VM; refactoring & tests update (f3b669b)
by vgologuz@fedoraproject.org
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit f3b669be08fa2c5c1e2b5701adfa4cb8049c0c3e
Author: Valentin Gologuzov <vgologuz(a)redhat.com>
Date: Fri Dec 12 11:38:40 2014 +0100
[backend] bugfix: when dispatcher has vm_ip it shouldn't start new VM; refactoring & tests update
>---------------------------------------------------------------
backend/backend/daemons/dispatcher.py | 109 +++++++++--------
backend/backend/sign.py | 3 +-
backend/tests/deamons/test_dispatcher.py | 190 +++++++++++++++++++++--------
3 files changed, 197 insertions(+), 105 deletions(-)
diff --git a/backend/backend/daemons/dispatcher.py b/backend/backend/daemons/dispatcher.py
index fe046f8..6c980ff 100644
--- a/backend/backend/daemons/dispatcher.py
+++ b/backend/backend/daemons/dispatcher.py
@@ -71,6 +71,7 @@ class WorkerCallback(object):
.format(self.logfile, str(e)))
+# TODO: Extract VmManager class
class Worker(multiprocessing.Process):
"""
@@ -94,6 +95,8 @@ class Worker(multiprocessing.Process):
# base class initialization
multiprocessing.Process.__init__(self, name="worker-builder")
+ self.opts = opts
+
# job management stuff
self.task_queue = Queue("copr-be-{0}".format(str(group_id)))
self.task_queue.connect()
@@ -101,14 +104,10 @@ class Worker(multiprocessing.Process):
self.events = events
self.worker_num = worker_num
self.group_id = group_id
- self.vm_name = None
- self.opts = opts
- self.kill_received = False
+ self.kill_received = False
self.lock = lock
- self.spawn_in_advance = self.opts.spawn_in_advance
self.frontend_callback = FrontendClient(opts, events)
-
self.callback = callback
if not self.callback:
log_name = "worker-{0}-{1}.log".format(
@@ -118,6 +117,8 @@ class Worker(multiprocessing.Process):
self.logfile = os.path.join(self.opts.worker_logdir, log_name)
self.callback = WorkerCallback(logfile=self.logfile)
+ self.vm_name = None
+ self.vm_ip = None
self.callback.log("creating worker: dynamic ip")
def event(self, topic, template, content=None):
@@ -149,7 +150,7 @@ class Worker(multiprocessing.Process):
# XXX - Maybe log traceback as well with traceback.format_exc()
self.callback.log("failed to publish message: {0}".format(e))
- def _announce_start(self, job, ip="none"):
+ def _announce_start(self, job):
"""
Announce everywhere that a build process started now.
"""
@@ -161,7 +162,7 @@ class Worker(multiprocessing.Process):
content = dict(user=job.submitter, copr=job.project_name,
owner=job.project_owner,
- build=job.build_id, ip=ip, pid=self.pid)
+ build=job.build_id, ip=self.vm_ip, pid=self.pid)
self.event("build.start", template, content)
template = "chroot start: chroot:{chroot} user:{user}" \
@@ -170,24 +171,24 @@ class Worker(multiprocessing.Process):
content = dict(chroot=job.chroot, user=job.submitter,
owner=job.project_owner,
copr=job.project_name, build=job.build_id,
- ip=ip, pid=self.pid)
+ ip=self.vm_ip, pid=self.pid)
self.event("chroot.start", template, content)
- def _announce_end(self, job, ip="none"):
+ def _announce_end(self, job):
"""
Announce everywhere that a build process ended now.
"""
job.ended_on = time.time()
self.return_results(job)
- self.callback.log("worker finished build: {0}".format(ip))
+ self.callback.log("worker finished build: {0}".format(self.vm_ip))
template = "build end: user:{user} copr:{copr} build:{build}" \
" ip:{ip} pid:{pid} status:{status}"
content = dict(user=job.submitter, copr=job.project_name,
owner=job.project_owner,
- build=job.build_id, ip=ip, pid=self.pid,
+ build=job.build_id, ip=self.vm_ip, pid=self.pid,
status=job.status, chroot=job.chroot)
self.event("build.end", template, content)
@@ -223,7 +224,7 @@ class Worker(multiprocessing.Process):
self.callback.log(name + ": end")
return result
- def validate_new_vm(self, ipaddr):
+ def validate_vm(self):
"""
Test connectivity to the VM
@@ -234,8 +235,8 @@ class Worker(multiprocessing.Process):
# that's why I'm testing the connectivity here
runner_options = dict(
remote_user="root",
- host_list="{},".format(ipaddr),
- pattern=ipaddr,
+ host_list="{},".format(self.vm_ip),
+ pattern=self.vm_ip,
forks=1,
transport=self.opts.ssh.transport,
timeout=500
@@ -249,15 +250,15 @@ class Worker(multiprocessing.Process):
except Exception as exception:
raise CoprWorkerSpawnFailError(
"Failed to check created VM ({})"
- "due to ansible error: {}".format(ipaddr, exception))
+ "due to ansible error: {}".format(self.vm_ip, exception))
- if ipaddr not in res.get("contacted", {}):
+ if self.vm_ip not in res.get("contacted", {}):
self.callback.log(
"Worker is not responding to the testing playbook. Terminating it."
"Runner options: {}".format(runner_options) +
"Ansible raw response:\n{}".format(res))
raise CoprWorkerSpawnFailError("Created VM ({}) was unresponsive "
- "and therefore terminated".format(ipaddr))
+ "and therefore terminated".format(self.vm_ip))
def try_spawn(self, args):
"""
@@ -311,40 +312,39 @@ class Worker(multiprocessing.Process):
try:
spawn_playbook = self.opts.build_groups[self.group_id]["spawn_playbook"]
except KeyError:
- return None
+ return
spawn_args = "-c ssh {}".format(spawn_playbook)
# TODO: replace with for i in range(MAX_SPAWN_TRIES): ... else raise FatalError
i = 0
- while True:
+ while self.vm_ip is None:
i += 1
try:
self.callback.log("Spawning a builder. Try No. {0}".format(i))
- ipaddr = self.try_spawn(spawn_args)
+ self.vm_ip = self.try_spawn(spawn_args)
try:
- self.validate_new_vm(ipaddr)
+ self.validate_vm()
except CoprWorkerSpawnFailError:
- self.terminate_instance(ipaddr)
+ self.terminate_instance()
raise
self.callback.log("Instance spawn/provision took {0} sec"
.format(time.time() - start))
- return ipaddr
except CoprWorkerSpawnFailError as exception:
self.callback.log("VM Spawn attemp failed with message: {}"
.format(exception.msg))
- def terminate_instance(self, instance_ip):
+ def terminate_instance(self):
"""
Call the terminate playbook to destroy the building instance
"""
term_args = {}
if "ip" in self.opts.terminate_vars:
- term_args["ip"] = instance_ip
+ term_args["ip"] = self.vm_ip
if "vm_name" in self.opts.terminate_vars:
term_args["vm_name"] = self.vm_name
@@ -357,9 +357,12 @@ class Worker(multiprocessing.Process):
sys.exit(255)
args = "-c ssh -i '{0},' {1} {2}".format(
- instance_ip, playbook,
+ self.vm_ip, playbook,
ans_extra_vars_encode(term_args, "copr_task"))
self.run_ansible_playbook(args, "terminate instance")
+ # TODO: should we check that machine was destroyed?
+ self.vm_ip = None
+ self.vm_name = None
def mark_started(self, job):
"""
@@ -440,15 +443,14 @@ class Worker(multiprocessing.Process):
- :py:class:`AnsibleError`: failure during anible command execution
"""
try:
- ip = self.spawn_instance()
- if not ip:
+ self.spawn_instance()
+ if not self.vm_ip:
# TODO: maybe add specific exception?
raise CoprWorkerError(
"No IP found from creating instance")
except AnsibleError as e:
self.callback.log("failure to setup instance: {0}".format(e))
raise
- return ip
def init_fedmsg(self):
"""
@@ -517,14 +519,13 @@ class Worker(multiprocessing.Process):
return job
- def do_job(self, ip, job):
+ def do_job(self, job):
"""
Executes new job.
- :param ip: ip address of the builder VM
:param job: :py:class:`~backend.job.BuildJob`
"""
- self._announce_start(job, ip)
+ self._announce_start(job)
status = BuildStatus.SUCCEEDED
chroot_destdir = os.path.normpath(job.destdir + '/' + job.chroot)
@@ -551,7 +552,7 @@ class Worker(multiprocessing.Process):
self.callback.log(
"Starting build: id={0} builder={1} timeout={2} destdir={3}"
" chroot={4} repos={5}"
- .format(job.build_id, ip, job.timeout, job.destdir,
+ .format(job.build_id, self.vm_ip, job.timeout, job.destdir,
job.chroot, str(job.repos)))
self.callback.log("Building pkgs: {0}".format(job.pkg))
@@ -573,7 +574,7 @@ class Worker(multiprocessing.Process):
try:
mr = MockRemote(
- builder_host=ip, job=job, repos=chroot_repos,
+ builder_host=self.vm_ip, job=job, repos=chroot_repos,
macros=macros, opts=self.opts, lock=self.lock,
callback=CliLogCallBack(quiet=True, logfn=chroot_logfile),
)
@@ -585,17 +586,29 @@ class Worker(multiprocessing.Process):
except MockRemoteError as e:
# record and break
- self.callback.log("{0} - {1}".format(ip, e))
+ self.callback.log("{0} - {1}".format(self.vm_ip, e))
status = BuildStatus.FAILURE
self.callback.log(
"Finished build: id={0} builder={1} timeout={2} destdir={3}"
" chroot={4} repos={5}"
- .format(job.build_id, ip, job.timeout, job.destdir,
+ .format(job.build_id, self.vm_ip, job.timeout, job.destdir,
job.chroot, str(job.repos)))
job.status = status
- self._announce_end(job, ip)
+ self._announce_end(job)
+
+ def check_vm_still_alive(self):
+ """
+ Ensure that if we have vm_ip it is alive.
+ Terminates unresponsive instance.
+ """
+ if self.vm_ip:
+ # TODO: extract method: check_vm_still_alive
+ try:
+ self.validate_vm()
+ except CoprWorkerSpawnFailError:
+ self.terminate_instance()
def run(self):
"""
@@ -608,28 +621,22 @@ class Worker(multiprocessing.Process):
"""
self.init_fedmsg()
- vm_ip = None
while not self.kill_received:
- if self.opts.spawn_in_advance:
- vm_ip = self.spawn_instance_with_check()
+ self.check_vm_still_alive()
+
+ if self.opts.spawn_in_advance and not self.vm_ip:
+ self.spawn_instance_with_check()
job = self.obtain_job()
if not job:
time.sleep(self.opts.sleeptime)
continue
- if not vm_ip:
- vm_ip = self.spawn_instance_with_check()
+ if not self.vm_ip:
+ self.spawn_instance_with_check()
try:
- self.do_job(vm_ip, job)
+ self.do_job(job)
finally:
# clean up the instance
- self.terminate_instance(vm_ip)
- vm_ip = None
-
- # TODO: since spawn requires job object to create vm
- # it's possible to have spawned VM with incorrect configuration
- # disabling spawn in advance for now
- # if self.spawn_in_advance:
- # vm_ip = self.spawn_instance_with_check(job)
+ self.terminate_instance()
diff --git a/backend/backend/sign.py b/backend/backend/sign.py
index e44b60f..f207970 100755
--- a/backend/backend/sign.py
+++ b/backend/backend/sign.py
@@ -24,7 +24,8 @@ def create_gpg_email(username, projectname):
"""
Creates canonical name_email to identify gpg key
"""
- return "{}_{}(a)copr.{}".format(username, projectname, DOMAIN)
+
+ return "{}#{}(a)copr.{}".format(username, projectname, DOMAIN)
def get_pubkey(username, projectname, outfile=None):
diff --git a/backend/tests/deamons/test_dispatcher.py b/backend/tests/deamons/test_dispatcher.py
index 9a90daf..7f7484a 100644
--- a/backend/tests/deamons/test_dispatcher.py
+++ b/backend/tests/deamons/test_dispatcher.py
@@ -122,6 +122,20 @@ class TestDispatcher(object):
callback=self.worker_callback,
)
+ def set_ip(*args, **kwargs):
+ self.worker.vm_ip = self.vm_ip
+
+ def erase_ip(*args, **kwargs):
+ self.worker.vm_ip = None
+
+ self.set_ip = set_ip
+
+ @pytest.fixture
+ def reg_vm(self):
+ # call only with init_worker fixture
+ self.worker.vm_name = self.vm_name
+ self.worker.vm_ip = self.vm_ip
+
def teardown_method(self, method):
# print("\nremove: {}".format(self.tmp_dir_path))
shutil.rmtree(self.tmp_dir_path)
@@ -150,15 +164,15 @@ class TestDispatcher(object):
def test_spawn_instance_with_check(self, init_worker):
self.worker.spawn_instance = MagicMock()
- self.worker.spawn_instance.return_value = self.vm_ip
- assert self.vm_ip == self.worker.spawn_instance_with_check()
+ self.worker.spawn_instance.side_effect = self.set_ip
+
+ self.worker.spawn_instance_with_check()
+ assert self.vm_ip == self.worker.vm_ip
def test_spawn_instance_with_check_no_ip(self, init_worker):
self.worker.spawn_instance = MagicMock()
- self.worker.spawn_instance.return_value = None
- # with pytest.raises(ansible.errors.AnsibleError):
with pytest.raises(CoprWorkerError):
self.worker.spawn_instance_with_check()
@@ -172,21 +186,23 @@ class TestDispatcher(object):
def test_spawn_instance_missing_playbook_for_group_id(self, init_worker):
self.worker.try_spawn = MagicMock()
- self.worker.validate_new_vm = MagicMock()
+ self.worker.validate_vm = MagicMock()
self.worker.group_id = "175"
- assert self.worker.spawn_instance() is None
+ self.worker.spawn_instance()
+ assert self.worker.vm_ip is None
assert not self.worker.try_spawn.called
- assert not self.worker.validate_new_vm.called
+ assert not self.worker.validate_vm.called
def test_spawn_instance_ok_immediately(self, init_worker):
self.worker.try_spawn = MagicMock()
self.worker.try_spawn.return_value = self.vm_ip
- self.worker.validate_new_vm = MagicMock()
+ self.worker.validate_vm = MagicMock()
- assert self.worker.spawn_instance() == self.vm_ip
+ self.worker.spawn_instance()
+ assert self.worker.vm_ip == self.vm_ip
assert self.worker.try_spawn.called
- assert self.worker.validate_new_vm.called
+ assert self.worker.validate_vm.called
def test_spawn_instance_error_once_try_spawn(self, init_worker):
self.worker.try_spawn = MagicMock()
@@ -194,37 +210,40 @@ class TestDispatcher(object):
CoprWorkerSpawnFailError("foobar"),
self.vm_ip
]
- self.worker.validate_new_vm = MagicMock()
+ self.worker.validate_vm = MagicMock()
- assert self.worker.spawn_instance() == self.vm_ip
+ self.worker.spawn_instance()
+ assert self.worker.vm_ip == self.vm_ip
assert len(self.worker.try_spawn.call_args_list) == 2
- assert len(self.worker.validate_new_vm.call_args_list) == 1
+ assert len(self.worker.validate_vm.call_args_list) == 1
def test_spawn_instance_error_once_validate_new_vm(self, init_worker):
- self.worker.terminate_instance = MagicMock()
+ self.worker.run_ansible_playbook = MagicMock()
+
self.worker.try_spawn = MagicMock()
self.worker.try_spawn.return_value = self.vm_ip
- self.worker.validate_new_vm = MagicMock()
- self.worker.validate_new_vm.side_effect = [
+ self.worker.validate_vm = MagicMock()
+ self.worker.validate_vm.side_effect = [
CoprWorkerSpawnFailError("foobar"),
None,
]
- assert self.worker.spawn_instance() == self.vm_ip
+ self.worker.spawn_instance()
+ assert self.worker.vm_ip == self.vm_ip
assert len(self.worker.try_spawn.call_args_list) == 2
- assert len(self.worker.validate_new_vm.call_args_list) == 2
- assert self.worker.terminate_instance.called_once
+ assert len(self.worker.validate_vm.call_args_list) == 2
def test_spawn_instance_ok_immediately_passed_args(self, init_worker):
self.worker.try_spawn = MagicMock()
self.worker.try_spawn.return_value = self.vm_ip
- self.worker.validate_new_vm = MagicMock()
+ self.worker.validate_vm = MagicMock()
+
+ self.worker.spawn_instance()
- assert self.worker.spawn_instance() == self.vm_ip
assert self.worker.try_spawn.called
- assert self.worker.validate_new_vm.called
+ assert self.worker.validate_vm.called
assert self.worker.try_spawn.call_args == mock.call(self.try_spawn_args)
@@ -262,54 +281,53 @@ class TestDispatcher(object):
self.worker.try_spawn(self.try_spawn_args)
@mock.patch("backend.daemons.dispatcher.ansible.runner.Runner")
- def test_validate_new_vm(self, mc_runner, init_worker):
+ def test_validate_new_vm(self, mc_runner, init_worker, reg_vm):
mc_ans_conn = MagicMock()
mc_ans_conn.run.return_value = {"contacted": {self.vm_ip: "ok"}}
-
mc_runner.return_value = mc_ans_conn
- self.worker.validate_new_vm(self.vm_ip)
+
+ self.worker.validate_vm()
assert mc_ans_conn.run.called
@mock.patch("backend.daemons.dispatcher.ansible.runner.Runner")
- def test_validate_new_vm_ans_error(self, mc_runner, init_worker):
+ def test_validate_new_vm_ans_error(self, mc_runner, init_worker, reg_vm):
mc_ans_conn = MagicMock()
mc_ans_conn.run.side_effect = IOError()
-
mc_runner.return_value = mc_ans_conn
+
with pytest.raises(CoprWorkerSpawnFailError):
- self.worker.validate_new_vm(self.vm_ip)
+ self.worker.validate_vm()
assert mc_ans_conn.run.called
-
@mock.patch("backend.daemons.dispatcher.ansible.runner.Runner")
- def test_validate_new_vm_bad_response(self, mc_runner, init_worker):
+ def test_validate_new_vm_bad_response(self, mc_runner, init_worker, reg_vm):
mc_ans_conn = MagicMock()
mc_ans_conn.run.return_value = {"contacted": {}}
-
mc_runner.return_value = mc_ans_conn
with pytest.raises(CoprWorkerSpawnFailError):
- self.worker.validate_new_vm(self.vm_ip)
+ self.worker.validate_vm()
assert mc_ans_conn.run.called
- def test_terminate_instance(self, init_worker):
+ def test_terminate_instance(self, init_worker, reg_vm):
mc_run_ans = MagicMock()
self.worker.run_ansible_playbook = mc_run_ans
- self.worker.terminate_instance(self.vm_ip)
+ self.worker.terminate_instance()
assert mc_run_ans.called
expected_call = mock.call(
"-c ssh -i '{},' {} ".format(self.vm_ip, self.terminate_pb),
'terminate instance')
assert expected_call == mc_run_ans.call_args
+ assert self.worker.vm_ip is None
+ assert self.worker.vm_name is None
- def test_terminate_instance_with_vm_name(self, init_worker):
+ def test_terminate_instance_with_vm_name(self, init_worker, reg_vm):
mc_run_ans = MagicMock()
self.worker.run_ansible_playbook = mc_run_ans
self.opts.terminate_vars = ["vm_name"]
- self.worker.vm_name = self.vm_name
- self.worker.terminate_instance(self.vm_ip)
+ self.worker.terminate_instance()
assert mc_run_ans.called
expected_call = mock.call(
'-c ssh -i \'{},\' {} --extra-vars=\'{{"copr_task": {{"vm_name": "{}"}}}}\''
@@ -317,14 +335,15 @@ class TestDispatcher(object):
'terminate instance')
assert expected_call == mc_run_ans.call_args
+ assert self.worker.vm_ip is None
+ assert self.worker.vm_name is None
- def test_terminate_instance_with_ip_and_vm_name(self, init_worker):
+ def test_terminate_instance_with_ip_and_vm_name(self, init_worker, reg_vm):
mc_run_ans = MagicMock()
self.worker.run_ansible_playbook = mc_run_ans
self.opts.terminate_vars = ["ip", "vm_name"]
- self.worker.vm_name = self.vm_name
- self.worker.terminate_instance(self.vm_ip)
+ self.worker.terminate_instance()
assert mc_run_ans.called
expected_call = mock.call(
@@ -334,13 +353,16 @@ class TestDispatcher(object):
'terminate instance')
assert expected_call == mc_run_ans.call_args
+ assert self.worker.vm_ip is None
+ assert self.worker.vm_name is None
- def test_terminate_instance_missed_playbook(self, init_worker):
+ def test_terminate_instance_missed_playbook(self, init_worker, reg_vm):
mc_run_ans = MagicMock()
self.worker.run_ansible_playbook = mc_run_ans
self.worker.group_id = "322"
+
with pytest.raises(SystemExit):
- self.worker.terminate_instance(self.vm_ip)
+ self.worker.terminate_instance()
assert not mc_run_ans.called
@mock.patch("backend.daemons.dispatcher.fedmsg")
@@ -391,8 +413,6 @@ class TestDispatcher(object):
assert mc_subprocess.check_output.call_args == mock.call(
'ansible-playbook -c ssh /spawn.yml', shell=True)
-
-
@mock.patch("backend.daemons.dispatcher.time")
@mock.patch("backend.daemons.dispatcher.subprocess")
def test_run_ansible_playbook_first_second_ok(self, mc_subprocess,
@@ -520,43 +540,44 @@ class TestDispatcher(object):
@mock.patch("backend.daemons.dispatcher.MockRemote")
@mock.patch("backend.daemons.dispatcher.os")
- def test_do_job_failure_on_mkdirs(self, mc_os, mc_mr, init_worker):
+ 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()
self.worker.frontend_callback = self.worker_fe_callback
- self.worker.do_job(self.vm_ip, self.job)
+
+ self.worker.do_job(self.job)
assert self.job.status == BuildStatus.FAILURE
assert not mc_mr.called
@mock.patch("backend.daemons.dispatcher.MockRemote")
- def test_do_job(self, mc_mr_class, init_worker):
+ def test_do_job(self, mc_mr_class, init_worker, reg_vm):
assert not os.path.exists(self.DESTDIR_CHROOT)
self.worker.frontend_callback = self.worker_fe_callback
- self.worker.do_job(self.vm_ip, self.job)
+ self.worker.do_job(self.job)
assert self.job.status == BuildStatus.SUCCEEDED
assert os.path.exists(self.DESTDIR_CHROOT)
@mock.patch("backend.daemons.dispatcher.MockRemote")
- def test_do_job_updates_details(self, mc_mr_class, init_worker):
+ def test_do_job_updates_details(self, mc_mr_class, init_worker, reg_vm):
assert not os.path.exists(self.DESTDIR_CHROOT)
mc_mr_class.return_value.build_pkg.return_value = {
"results": self.test_time,
}
self.worker.frontend_callback = self.worker_fe_callback
- self.worker.do_job(self.vm_ip, self.job)
+ self.worker.do_job(self.job)
assert self.job.status == BuildStatus.SUCCEEDED
assert self.job.results == self.test_time
assert os.path.exists(self.DESTDIR_CHROOT)
@mock.patch("backend.daemons.dispatcher.MockRemote")
- def test_do_job_mr_error(self, mc_mr_class, init_worker):
+ def test_do_job_mr_error(self, mc_mr_class, init_worker, reg_vm):
mc_mr_class.return_value.build_pkg.side_effect = MockRemoteError("foobar")
self.worker.frontend_callback = self.worker_fe_callback
- self.worker.do_job(self.vm_ip, self.job)
+ self.worker.do_job(self.job)
assert self.job.status == BuildStatus.FAILURE
@mock.patch("backend.daemons.dispatcher.fedmsg")
@@ -666,7 +687,7 @@ class TestDispatcher(object):
self.worker.opts.spawn_in_advance = True
self.worker.init_fedmsg = MagicMock()
self.worker.spawn_instance_with_check = MagicMock()
- self.worker.spawn_instance_with_check.return_value = self.vm_ip
+ self.worker.spawn_instance_with_check.side_effect = self.set_ip
self.worker.obtain_job = MagicMock()
self.worker.obtain_job.return_value = self.job
@@ -690,6 +711,69 @@ class TestDispatcher(object):
self.worker.run()
+ @mock.patch("backend.daemons.dispatcher.time")
+ def test_run_spawn_in_advance_with_existing_vm(self, mc_time, init_worker):
+ self.worker.opts.spawn_in_advance = True
+ self.worker.init_fedmsg = MagicMock()
+ self.worker.spawn_instance_with_check = MagicMock()
+ self.worker.spawn_instance_with_check.side_effect = self.set_ip
+
+ self.worker.check_vm_still_alive = MagicMock()
+
+ self.worker.obtain_job = MagicMock()
+ self.worker.obtain_job.side_effect = [
+ None,
+ self.job,
+ ]
+
+ def validate_spawn():
+ assert self.worker.spawn_instance_with_check.called
+ self.worker.spawn_instance_with_check.reset_mock()
+ return mock.DEFAULT
+
+ self.worker.obtain_job.side_effect = validate_spawn
+ self.worker.terminate_instance = MagicMock()
+
+ mc_do_job = MagicMock()
+ self.worker.do_job = mc_do_job
+
+ def stop_loop(*args, **kwargs):
+ assert not self.worker.spawn_instance_with_check.called
+ self.worker.kill_received = True
+
+ mc_do_job.side_effect = stop_loop
+
+ self.worker.run()
+ assert self.worker.check_vm_still_alive.called
+ assert self.worker.spawn_instance_with_check.called_once
+
+ def test_check_vm_still_alive(self, init_worker):
+ self.worker.validate_vm = MagicMock()
+ self.worker.terminate_instance = MagicMock()
+
+ self.worker.check_vm_still_alive()
+
+ assert not self.worker.validate_vm.called
+ assert not self.worker.terminate_instance.called
+
+ def test_check_vm_still_alive_ok(self, init_worker, reg_vm):
+ self.worker.validate_vm = MagicMock()
+ self.worker.terminate_instance = MagicMock()
+
+ self.worker.check_vm_still_alive()
+
+ assert self.worker.validate_vm.called
+ assert not self.worker.terminate_instance.called
+
+ def test_check_vm_still_alive_not_ok(self, init_worker, reg_vm):
+ self.worker.validate_vm = MagicMock()
+ self.worker.validate_vm.side_effect = CoprWorkerSpawnFailError("foobar")
+ self.worker.terminate_instance = MagicMock()
+
+ self.worker.check_vm_still_alive()
+
+ assert self.worker.validate_vm.called
+ assert self.worker.terminate_instance.called
@mock.patch("backend.daemons.dispatcher.time")
def test_run_finalize(self, mc_time, init_worker):
9 years, 4 months
[copr] master: [backend] run tests during rpm build (b9abec0)
by vgologuz@fedoraproject.org
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit b9abec09ef90667b7d9f23a5ad8b2639434341a4
Author: Valentin Gologuzov <vgologuz(a)redhat.com>
Date: Thu Dec 11 16:23:38 2014 +0100
[backend] run tests during rpm build
>---------------------------------------------------------------
backend/copr-backend.spec | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/backend/copr-backend.spec b/backend/copr-backend.spec
index df0e1b8..6128a81 100644
--- a/backend/copr-backend.spec
+++ b/backend/copr-backend.spec
@@ -31,6 +31,9 @@ BuildRequires: python-argparse
#for doc package
BuildRequires: epydoc
BuildRequires: graphviz
+BuildRequires: pytest
+BuildRequires: python-mock
+BuildRequires: python-six
Requires: obs-signd
Requires: ansible >= 1.2
@@ -48,6 +51,7 @@ Requires: python-requests
Requires: python-setproctitle
Requires: python-retask
Requires: python-copr
+Requires: python-six
Requires: redis
Requires: logrotate
Requires: fedmsg
@@ -129,6 +133,12 @@ install -m 0644 conf/copr.sudoers.d %{buildroot}%{_sysconfdir}/sudoers.d/copr
cp -a documentation/python-doc %{buildroot}%{_pkgdocdir}/
cp -a conf/playbooks %{buildroot}%{_pkgdocdir}/
+%check
+
+PYTHONPATH=backend:run:$PYTHONPATH python -B -m pytest \
+ -s --cov-report term-missing --cov ./backend --cov ./run ./tests/
+
+
%pre
getent group copr >/dev/null || groupadd -r copr
getent passwd copr >/dev/null || \
9 years, 4 months
[copr] master: Automatic commit of package [copr-frontend] release [1.50-1]. (ce9e709)
by vgologuz@fedoraproject.org
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit ce9e709a45edc738f4d8430e84cb8439a462610c
Author: Valentin Gologuzov <vgologuz(a)redhat.com>
Date: Thu Dec 11 14:53:40 2014 +0100
Automatic commit of package [copr-frontend] release [1.50-1].
>---------------------------------------------------------------
frontend/copr-frontend.spec | 5 ++++-
rel-eng/packages/copr-frontend | 2 +-
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/frontend/copr-frontend.spec b/frontend/copr-frontend.spec
index ba4c6da..624b56f 100644
--- a/frontend/copr-frontend.spec
+++ b/frontend/copr-frontend.spec
@@ -5,7 +5,7 @@
%endif
Name: copr-frontend
-Version: 1.49
+Version: 1.50
Release: 1%{?dist}
Summary: Frontend for Copr
@@ -168,6 +168,9 @@ service httpd condrestart
%doc documentation/python-doc
%changelog
+* Thu Dec 11 2014 Valentin Gologuzov <vgologuz(a)redhat.com> 1.50-1
+- fix unittest
+
* Thu Dec 11 2014 Valentin Gologuzov <vgologuz(a)redhat.com> 1.49-1
- api workaround: removed auto_createrepo option
- show copr-frontend version;
diff --git a/rel-eng/packages/copr-frontend b/rel-eng/packages/copr-frontend
index fd34464..e0bac40 100644
--- a/rel-eng/packages/copr-frontend
+++ b/rel-eng/packages/copr-frontend
@@ -1 +1 @@
-1.49-1 frontend/
+1.50-1 frontend/
9 years, 4 months
[copr] master: [frontend] fix unittest (e3d7d7b)
by vgologuz@fedoraproject.org
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit e3d7d7b3cb72e304a55613a36d9292a515cdd1fc
Author: Valentin Gologuzov <vgologuz(a)redhat.com>
Date: Thu Dec 11 14:49:45 2014 +0100
[frontend] fix unittest
>---------------------------------------------------------------
.../test_views/test_api_ns/test_api_general.py | 5 +----
1 files changed, 1 insertions(+), 4 deletions(-)
diff --git a/frontend/coprs_frontend/tests/test_views/test_api_ns/test_api_general.py b/frontend/coprs_frontend/tests/test_views/test_api_ns/test_api_general.py
index 90ae8e6..f9c6cd9 100644
--- a/frontend/coprs_frontend/tests/test_views/test_api_ns/test_api_general.py
+++ b/frontend/coprs_frontend/tests/test_views/test_api_ns/test_api_general.py
@@ -73,8 +73,7 @@ class TestCreateCopr(CoprsTestCase):
"repos": self.repos,
"initial_pkgs": self.initial_pkgs,
"description": self.description,
- "instructions": self.instructions,
- "auto_createrepo": False
+ "instructions": self.instructions
}
content_encoded = json.dumps(content)
@@ -95,5 +94,3 @@ class TestCreateCopr(CoprsTestCase):
assert copr.owner.id == self.u1.id
assert copr.description == self.description
assert copr.instructions == self.instructions
-
- assert not copr.auto_createrepo
9 years, 4 months