Konstantin,

Once more unto the breach, dear friends, once more....

Save the attached patch as
/usr/lib/python2.7/site-packages/repo_file.patch. Then:

$ cd /usr/lib/python2.7/site-packages/
$ sudo patch -*p2* < repo_file.patch

Here's the run from my test machine:

===
[vagrant@centos7 ~]$ python
Python 2.7.5 (default, Apr  2 2020, 13:16:51)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pulp_rpm.handlers.repo_file
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/site-packages/pulp_rpm/handlers/repo_file.py",
line 6, in <module>
    from pulp.plugins.util import misc
*ImportError*: No module named plugins.util
>>>
[vagrant@centos7 ~]$ *cd /usr/lib/python2.7/site-packages/*
[vagrant@centos7 site-packages]$ *sudo patch -p2 < repo_file.patch*

*patching file pulp_rpm/handlers/repo_file.py*[vagrant@centos7
site-packages]$ python
Python 2.7.5 (default, Apr  2 2020, 13:16:51)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pulp_rpm.handlers.repo_file
>>>
[vagrant@centos7 site-packages]$
===

We'll work to get a 2.21.4-3 out to fix this in the repos, but this should
get you past the problem in the meantime.

G


On Wed, Nov 18, 2020 at 7:47 AM Grant Gainey <ggai...@redhat.com> wrote:

> Hey Konstantin,
>
> Ugh. Give me a bit this morning and I'll get you a patch, and then I'll
> talk to the Build Gang about getting a 2.21.4-3 put out. Apologies for
> missing these :(
>
> G
>
> On Wed, Nov 18, 2020 at 1:49 AM Konstantin M. Khankin <
> khankin.konstan...@gmail.com> wrote:
>
>> Looks like there is one more place where client relies on libraries
>> available only in the server package:
>>
>> <date> <host> goferd: [ERROR][worker-0] pulp.agent.lib.container:290 -
>> handler "bind", import failed
>> <date> <host> goferd: [ERROR][worker-0] pulp.agent.lib.container:290 -
>> Traceback (most recent call last):
>> <date> <host> goferd: [ERROR][worker-0] pulp.agent.lib.container:290 -
>> File "/usr/lib/python2.7/site-packages/pulp/agent/lib/container.py", line
>> 284, in __load
>> <date> <host> goferd: [ERROR][worker-0] pulp.agent.lib.container:290 -
>>   mod = self.__import_module(path)
>> <date> <host> goferd: [ERROR][worker-0] pulp.agent.lib.container:290 -
>> File "/usr/lib/python2.7/site-packages/pulp/agent/lib/container.py", line
>> 313, in __import_module
>> <date> <host> goferd: [ERROR][worker-0] pulp.agent.lib.container:290 -
>>   mod = __import__(path[0], globals(), locals(), [path[-1]])
>> <date> <host> goferd: [ERROR][worker-0] pulp.agent.lib.container:290 -
>> File "/usr/lib/python2.7/site-packages/pulp_rpm/handlers/bind.py", line 9,
>> in <module>
>> <date> <host> goferd: [ERROR][worker-0] pulp.agent.lib.container:290 -
>>   from pulp_rpm.handlers import repolib
>> <date> <host> goferd: [ERROR][worker-0] pulp.agent.lib.container:290 -
>> File "/usr/lib/python2.7/site-packages/pulp_rpm/handlers/repolib.py", line
>> 16, in <module>
>> <date> <host> goferd: [ERROR][worker-0] pulp.agent.lib.container:290 -
>>   from pulp_rpm.handlers.repo_file import Repo, RepoFile, MirrorListFile,
>> RepoKeyFiles, CertFiles
>> <date> <host> goferd: [ERROR][worker-0] pulp.agent.lib.container:290 -
>> File "/usr/lib/python2.7/site-packages/pulp_rpm/handlers/repo_file.py",
>> line 6, in <module>
>> <date> <host> goferd: [ERROR][worker-0] pulp.agent.lib.container:290 -
>>   from pulp.plugins.util import misc
>> <date> <host> goferd: [ERROR][worker-0] pulp.agent.lib.container:290 -
>> ImportError: No module named plugins.util
>>
>> вт, 10 нояб. 2020 г. в 17:52, Grant Gainey <ggai...@redhat.com>:
>>
>>> 2.21.4-2 has been released. The only change is the fix for 7803
>>> <https://pulp.plan.io/issues/7803>
>>>
>>> G
>>>
>>> On Mon, Nov 9, 2020 at 10:26 AM Grant Gainey <ggai...@redhat.com> wrote:
>>>
>>>> Hey folks,
>>>>
>>>> Just a heads-up that there will be a 2.21.4-2 turn of the build crank
>>>> this week in order to address issue 7803
>>>> <https://pulp.plan.io/issues/7803> . I will send out a notification
>>>> once the fixed RPMs are available.
>>>>
>>>> G
>>>> --
>>>> Grant Gainey
>>>> Principal Software Engineer, Red Hat System Management Engineering
>>>>
>>>
>>>
>>> --
>>> Grant Gainey
>>> Principal Software Engineer, Red Hat System Management Engineering
>>> _______________________________________________
>>> Pulp-list mailing list
>>> pulp-l...@redhat.com
>>> https://www.redhat.com/mailman/listinfo/pulp-list
>>
>>
>>
>> --
>> Ханкин Константин
>>
>
>
> --
> Grant Gainey
> Principal Software Engineer, Red Hat System Management Engineering
>


-- 
Grant Gainey
Principal Software Engineer, Red Hat System Management Engineering
diff --git a/handlers/pulp_rpm/handlers/repo_file.py b/handlers/pulp_rpm/handlers/repo_file.py
index 78a7ba52..f79af1ff 100644
--- a/handlers/pulp_rpm/handlers/repo_file.py
+++ b/handlers/pulp_rpm/handlers/repo_file.py
@@ -3,7 +3,6 @@ import shutil
 
 from iniparse import ConfigParser
 from pulp.common.util import encode_unicode
-from pulp.plugins.util import misc
 
 
 class Repo(dict):
@@ -410,7 +409,7 @@ class RepoKeyFiles(object):
         # If there are any keys to write, create the directory for the repo's keys
         # and write each of them out
         if len(self.keys) > 0:
-            misc.mkdir(self.repo_keys_dir)
+            os.makedirs(self.repo_keys_dir)
 
             for filename in self.keys:
                 f = open(filename, 'w')
@@ -460,7 +459,7 @@ class CertFiles(object):
         if not self.clientcert:
             return None
 
-        misc.mkdir(self.rootdir)
+        self.__mkdir()
         path = os.path.join(self.rootdir, self.CLIENT)
         f = open(path, 'w')
         f.write(self.clientcert)
@@ -470,6 +469,10 @@ class CertFiles(object):
     def __nocerts(self):
         return not self.clientcert
 
+    def __mkdir(self):
+        if not os.path.exists(self.rootdir):
+            os.makedirs(self.rootdir)
+
     def __clear(self):
         if os.path.exists(self.rootdir):
             shutil.rmtree(self.rootdir)
_______________________________________________
Pulp-dev mailing list
Pulp-dev@redhat.com
https://www.redhat.com/mailman/listinfo/pulp-dev

Reply via email to