From b1f52065532abe840cfc000fb102325275b07f95 Mon Sep 17 00:00:00 2001
From: Jan Scotka <jscotka@redhat.com>
Date: Jun 28 2017 07:44:18 +0000
Subject: [PATCH 1/2] added link to official compose instead of jkaluza's one


---

diff --git a/docs/example-config.yaml b/docs/example-config.yaml
index f58e66d..bf667cb 100644
--- a/docs/example-config.yaml
+++ b/docs/example-config.yaml
@@ -74,7 +74,7 @@ module:
 # use "compose", this will be ignored
 # env var: URL
 # MANDATORY
-        repo: https://kojipkgs.stg.fedoraproject.org/compose/branched/jkaluza/latest-Fedora-Modular-26/compose/Server/x86_64/os/
+        repo: https://kojipkgs.fedoraproject.org/compose/latest-Fedora-Modular-26/compose/Server/x86_64/os/
 # if you will not use "compose" nor repo, you can use repos, which caused that just mentioned
 # repos will be used, not additional repos from moduleMD file
 # env var: URL
diff --git a/docs/user_guide/example_config_minimal.yaml b/docs/user_guide/example_config_minimal.yaml
index d079c36..ceb3171 100644
--- a/docs/user_guide/example_config_minimal.yaml
+++ b/docs/user_guide/example_config_minimal.yaml
@@ -10,6 +10,6 @@ module:
     docker:
         container: docker.io/phracek/memcached
     rpm:
-        repo: https://kojipkgs.stg.fedoraproject.org/compose/branched/jkaluza/latest-Fedora-Modular-26/compose/Server/x86_64/os/
+        repo: https://kojipkgs.fedoraproject.org/compose/latest-Fedora-Modular-26/compose/Server/x86_64/os/
 
 
diff --git a/moduleframework/common.py b/moduleframework/common.py
index 1fbda74..228155d 100644
--- a/moduleframework/common.py
+++ b/moduleframework/common.py
@@ -106,6 +106,7 @@ trans_dict = {"HOSTIPADDR": hostipaddr,
 
 
 PDCURL = "https://pdc.fedoraproject.org/rest_api/v1/unreleasedvariants"
+URLBASECOMPOSE = "https://kojipkgs.fedoraproject.org/compose/latest-Fedora-Modular-26/compose/Server"
 REPOMD = "repodata/repomd.xml"
 MODULEFILE = 'tempmodule.yaml'
 # default value of process timeout in sec
diff --git a/moduleframework/module_framework.py b/moduleframework/module_framework.py
index 63e5e89..de3264b 100755
--- a/moduleframework/module_framework.py
+++ b/moduleframework/module_framework.py
@@ -796,7 +796,7 @@ class NspawnHelper(RpmHelper):
             shutil.rmtree(self.chrootpath, ignore_errors=True)
             os.mkdir(self.chrootpath)
         try:
-            self.runHost("machinectl terminate %s" % self.jmeno, verbose=is_debug())
+            self.runHost("machinectl terminate %s" % self.jmeno, verbose=is_debug(), ignore_status=True)
             self.__is_killed()
         except BaseException:
             pass
diff --git a/moduleframework/pdc_data.py b/moduleframework/pdc_data.py
index 5aef6d9..e9fbfd5 100644
--- a/moduleframework/pdc_data.py
+++ b/moduleframework/pdc_data.py
@@ -152,7 +152,7 @@ class PDCParser():
         """
         # rpmrepo = "http://kojipkgs.fedoraproject.org/repos/%s/latest/%s" % (
         #    self.pdcdata["koji_tag"] + "-build", ARCH)
-        rpmrepo = "https://kojipkgs.stg.fedoraproject.org/compose/branched/jkaluza/latest-Fedora-Modular-26/compose/Server/%s/os/" % ARCH
+        rpmrepo = "%s/%s/os/" % (URLBASECOMPOSE, ARCH)
         return rpmrepo
 
     def generateGitHash(self):

From 4fbecd4ab3eaf0fc657ced3fe589a75930110b97 Mon Sep 17 00:00:00 2001
From: Jan Scotka <jscotka@redhat.com>
Date: Jun 28 2017 07:50:02 +0000
Subject: [PATCH 2/2] added doc string to helps to understand why MTF_RECURSIVE_DOWNLOAD


---

diff --git a/moduleframework/common.py b/moduleframework/common.py
index 228155d..e2d004c 100644
--- a/moduleframework/common.py
+++ b/moduleframework/common.py
@@ -156,4 +156,13 @@ def print_debug(*args):
         print_info(*args)
 
 def is_recursive_download():
-    return bool(os.environ.get("MTF_RECURSIVE_DOWNLOAD"))
\ No newline at end of file
+    """
+    Purpose: Workaround for taskotron
+    It changes behaviour of createLocalRepoFromKoji fuction of pdc_data module.
+    It tries to download all packages with all dependent modules, not just for one module.
+    It fixes issue with taskotron issues caused by checking stdout/stderr activity,
+    after 15 minutes without any output it is killed.
+
+    :return: bool
+    """
+    return bool(os.environ.get("MTF_RECURSIVE_DOWNLOAD"))

