Blob Blame Raw
From 3809fe6889eeb884e78685fd940c81dedbb6df4f Mon Sep 17 00:00:00 2001
From: Michael Goodwin <xenithorb@users.noreply.github.com>
Date: Thu, 28 Jul 2016 14:54:53 -0400
Subject: [PATCH] cls.chroot_config inside _guess_chroot returns None (RhBug:
 1361003)

---
 plugins/copr.py | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/plugins/copr.py b/plugins/copr.py
index f24c202..3994f23 100644
--- a/plugins/copr.py
+++ b/plugins/copr.py
@@ -136,7 +136,7 @@ class CoprCommand(dnf.cli.Command):
         try:
             chroot = extcmds[2]
         except IndexError:
-            chroot = self._guess_chroot()
+            chroot = self._guess_chroot(self.chroot_config)
 
         # commands without defined copr_username/copr_projectname
         if subcommand == "list":
@@ -261,11 +261,11 @@ Do you want to continue? [y/N]: """)
             raise dnf.exceptions.Error(
                 _('This command has to be run under the root user.'))
 
-    @classmethod
-    def _guess_chroot(cls):
+    @staticmethod
+    def _guess_chroot(chroot_config):
         """ Guess which chroot is equivalent to this machine """
         # FIXME Copr should generate non-specific arch repo
-        dist = cls.chroot_config
+        dist = chroot_config
         if dist is None or (dist[0] is False) or (dist[1] is False):
             dist = platform.linux_distribution()
         if "Fedora" in dist:
@@ -289,7 +289,7 @@ Do you want to continue? [y/N]: """)
 
     def _download_repo(self, project_name, repo_filename, chroot=None):
         if chroot is None:
-            chroot = self._guess_chroot()
+            chroot = self._guess_chroot(self.chroot_config)
         short_chroot = '-'.join(chroot.split('-')[:2])
         #http://copr.fedorainfracloud.org/coprs/larsks/rcm/repo/epel-7-x86_64/
         api_path = "/coprs/{0}/repo/{1}/".format(project_name, short_chroot)
@@ -434,7 +434,7 @@ Do you want to continue? [y/N]: """)
             raise dnf.cli.CliError(
                 _('exactly one parameter to '
                   'playground command is required'))
-        chroot = self._guess_chroot()
+        chroot = self._guess_chroot(self.chroot_config)
         if subcommand == "enable":
             self._cmd_enable(chroot)
             logger.info(_("Playground repositories successfully enabled."))
-- 
2.7.4