<div dir="ltr"><div>Hey Konstantin (and anyone else hitting this),</div><div><br></div><div>While we're figuring out the best way to address this, here's a quick fix:</div><div><br></div><div>Save the attached patch as /usr/lib/python2.7/site-packages/pulp-common.patch . Then:<br></div><div><br></div><div><font size="1" face="monospace">$ cd /usr/lib/python2.7/site-packages/</font></div><div><font size="1" face="monospace">$ sudo patch -p1 < pulp-common.patch</font></div><div><br></div><div>Here's the run from my test machine:</div><div><br></div><div><font face="monospace"><font size="1">[vagrant@centos7 ~]$ </font><font size="1"><b>cd /usr/lib/python2.7/site-packages/</b></font></font></div><div><font size="1" face="monospace">[vagrant@centos7 site-packages]$ <b>python</b><br>Python 2.7.5 (default, Apr  2 2020, 13:16:51) <br>[GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] on linux2<br>Type "help", "copyright", "credits" or "license" for more information.<br>>>> import pulp.common.bundle<br>Traceback (most recent call last):<br>  File "<stdin>", line 1, in <module><br>  File "pulp/common/bundle.py", line 4, in <module><br>    from pulp.plugins.util import misc<br><b>ImportError</b>: No module named plugins.util<br>>>> import pulp.common.lock<br>Traceback (most recent call last):<br>  File "<stdin>", line 1, in <module><br>  File "pulp/common/lock.py", line 10, in <module><br>    from pulp.plugins.util import misc<br><b>ImportError</b>: No module named plugins.util<br>>>> <br>[vagrant@centos7 site-packages]$ <b>sudo patch -p1 < pulp-common.patch</b> <br><b>patching file pulp/common/bundle.py<br>patching file pulp/common/lock.py</b><br>[vagrant@centos7 site-packages]$ python<br>Python 2.7.5 (default, Apr  2 2020, 13:16:51) <br>[GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] on linux2<br>Type "help", "copyright", "credits" or "license" for more information.<br>>>> import pulp.common.bundle<br>>>> import pulp.common.lock<br>>>> <br>[vagrant@centos7 site-packages]$ </font><br></div><div>===</div><div><br></div><div><br></div><div>G</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Nov 5, 2020 at 9:52 AM Grant Gainey <<a href="mailto:ggainey@redhat.com">ggainey@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Nov 3, 2020 at 2:14 PM Konstantin M. Khankin <<a href="mailto:khankin.konstantin@gmail.com" target="_blank">khankin.konstantin@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi!<div><br></div><div>This report is very similar to the one in <a href="https://pulp.plan.io/issues/5126" target="_blank">https://pulp.plan.io/issues/5126</a> or mail thread <a href="https://www.redhat.com/archives/pulp-list/2019-July/msg00021.html" target="_blank">https://www.redhat.com/archives/pulp-list/2019-July/msg00021.html</a>, the only difference is I get this error with the latest Pulp update 2.21.4:</div></div></blockquote><div><br></div><div>Uuugh, that would appear to be my fault as part of  e067d28a00bdec989dd03170d599e58cde4fba13</div><div><br></div><div>These two changes from that commit:</div><div><br></div><div>===</div><div><font size="1" face="monospace">diff --git a/common/pulp/common/bundle.py b/common/pulp/common/bundle.py<br>index 6ad95d498..be178b006 100644<br>--- a/common/pulp/common/bundle.py<br>+++ b/common/pulp/common/bundle.py<br>@@ -1,6 +1,7 @@<br> import os<br> import re<br> from logging import getLogger<br>+from pulp.plugins.util import misc<br> <br> from M2Crypto import X509<br> <br>@@ -199,8 +200,7 @@ class Bundle:<br>         Ensure I{root} directory exists.<br>         """<br>         path = os.path.dirname(self.path)<br>-        if not os.path.exists(path):<br>-            os.makedirs(path)<br>+        misc.mkdir(path)<br> <br>     def cn(self):<br>         """<br>diff --git a/common/pulp/common/lock.py b/common/pulp/common/lock.py<br>index 7fdf7e9b8..9caf9b1c7 100644<br>--- a/common/pulp/common/lock.py<br>+++ b/common/pulp/common/lock.py<br>@@ -7,6 +7,8 @@ import fcntl<br> <br> from threading import RLock<br> <br>+from pulp.plugins.util import misc<br>+<br> <br> class LockFailed(Exception):<br>     pass<br>@@ -92,8 +94,7 @@ class LockFile:<br> <br>     def __mkdir(self, path):<br>         dir = os.path.dirname(path)<br>-        if not os.path.exists(dir):<br>-            os.makedirs(dir)<br>+        misc.mkdir(dir)<br> <br> <br> class Lock:</font><br></div><div>===</div><div><br></div><div>are the problem, I believe. I'll work on figuring out how best to address the problem.</div><div><br></div><div>Konstantin, could you open an issue at <a href="http://pulp.plan.io" target="_blank">pulp.plan.io</a> please?  That way you'll see progress as we/I make it.</div><div><br></div><div>Thanks for the catch, and the great problem report!</div><div><br></div><div>G</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div> </div></div></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div># rpm -qa | grep pulp<br>python-pulp-client-lib-2.21.4-1.el7.noarch<br>python-pulp-common-2.21.4-1.el7.noarch<br>pulp-rpm-handlers-2.21.4-1.el7.noarch<br>python-pulp-rpm-common-2.21.4-1.el7.noarch<br>python-pulp-agent-lib-2.21.4-1.el7.noarch<br>pulp-agent-2.21.4-1.el7.noarch<br>pulp-puppet-consumer-extensions-2.21.4-1.el7.noarch<br>pulp-consumer-client-2.21.4-1.el7.noarch<br>pulp-rpm-yumplugins-2.21.4-1.el7.noarch<br>python-pulp-bindings-2.21.4-1.el7.noarch<br>pulp-rpm-consumer-extensions-2.21.4-1.el7.noarch<br>python-pulp-puppet-common-2.21.4-1.el7.noarch<br>pulp-puppet-handlers-2.21.4-1.el7.noarch<br><div><br></div><div>>>> import os<br>>>> d, m = os.path.split('/usr/lib/yum-plugins/pulp-profile-update.py')<br>>>> m = m.split('.py')[0]<br>>>> m<br>'pulp-profile-update'<br>>>> d<br>'/usr/lib/yum-plugins'<br>>>> import imp<br>>>> imp.find_module(m, [d])<br>(<open file '/usr/lib/yum-plugins/pulp-profile-update.py', mode 'U' at 0x7fbb0b54f5d0>, '/usr/lib/yum-plugins/pulp-profile-update.py', ('.py', 'U', 1))<br>>>> f, p, d = imp.find_module(m, [d])<br>>>> imp.load_module(m, f, p, d)<br>Traceback (most recent call last):<br>  File "<stdin>", line 1, in <module><br>  File "/usr/lib/yum-plugins/pulp-profile-update.py", line 7, in <module><br>    from pulp.common.bundle import Bundle as BundleImpl<br>  File "/usr/lib/python2.7/site-packages/pulp/common/bundle.py", line 4, in <module><br>    from pulp.plugins.util import misc<br>ImportError: No module named plugins.util<br></div><div><br></div><div># ls /usr/lib/python2.7/site-packages/pulp/<br>agent  bindings  client  common  __init__.py  __init__.pyc  __init__.pyo<br></div><div><br></div><div>===</div><div>At host where I don't have this error, ls gives:</div><div># ls /usr/lib/python2.7/site-packages/pulp<br>agent  bindings  client  common  __init__.py  __init__.pyc  __init__.pyo  oid_validation  plugins  repoauth  server<br><br></div><div># ls /usr/lib/python2.7/site-packages/pulp/plugins/<br>cataloger.py   conduits    config.pyo       distributor.pyo  importer.pyc  __init__.pyc  migration  model.pyo     profiler.pyo  util<br>cataloger.pyc  config.py   distributor.py   file             importer.pyo  __init__.pyo  model.py   profiler.py   rsync<br>cataloger.pyo  config.pyc  distributor.pyc  importer.py      __init__.py   loader        model.pyc  profiler.pyc  types<br></div><div><br></div><div># rpm -qf /usr/lib/python2.7/site-packages/pulp/plugins/util/misc.py<br>pulp-server-2.21.4-1.el7.noarch<br></div><div><br></div><div>===</div><div>Obviously if plugins/util/misc is included into the pulp-server package, it can only be found on a server. So same as in <a href="https://pulp.plan.io/issues/5126" target="_blank">https://pulp.plan.io/issues/5126</a>, 2.21.4 introduced server dependency on a client.</div><div><br></div><div>Could you move the plugins package into the pulp-common package please?</div><div><br></div><div>Thanks!</div><div><br></div>-- <br><div dir="ltr">Konstantin Khankin<br></div></div></div>
_______________________________________________<br>
Pulp-list mailing list<br>
<a href="mailto:Pulp-list@redhat.com" target="_blank">Pulp-list@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/pulp-list" rel="noreferrer" target="_blank">https://www.redhat.com/mailman/listinfo/pulp-list</a></blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div>Grant Gainey</div><div>Principal Software Engineer, Red Hat System Management Engineering</div></div></div></div></div></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Grant Gainey</div><div>Principal Software Engineer, Red Hat System Management Engineering</div></div></div></div></div></div>