Project

Profile

Help

Issue #587

pulp cant install package with version in it

Added by dhaval.joshi@nomura.com over 6 years ago. Updated over 2 years ago.

Status:
CLOSED - WONTFIX
Priority:
Normal
Assignee:
-
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
2.4.2
Platform Release:
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Quarter:

Description

Description of problem:pulp cant install package with version in it

Version-Release number of selected component (if applicable):2.4.2

[root@lonlx90008 yum.repos.d]# yum list |grep master_test
nm-python.x86_64 2.7.6-1 master_test
nm-python.x86_64 2.7.7-1 master_test

now I am trying “yum install”

[root@pulp-consumer yum.repos.d]# yum install nmr-python-2.7.6
Loaded plugins: product-id, pulp-profile-update, security
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package nmr-python.x86_64 0:2.7.6-1 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

==================================================================================================================
Package Arch Version Repository Size
==================================================================================================================
Installing:
nm-python x86_64 2.7.6-1 master_test 22 M

Transaction Summary
==================================================================================================================
Install 1 Package(s)

Total download size: 22 M
Installed size: 87 M
Is this ok [y/N]: n

Here I am trying “pulp-admin”

[root@pulp-admin 0]# pulp-admin -u admin -p admin rpm consumer package install run --consumer-id pulp-consumer--name nm-python-2.7.6
Install task created with id [ f9d1177d-4548-430d-b4ce-9b470a162228 ]

This command may be exited via ctrl+c without affecting the request.

Refresh Repository Metadata

Install Failed

:nm-python-2.7.6--*.*: No package(s) available to install

+ This bug was cloned from Bugzilla Bug #1155411 +

History

#1 Updated by jortel@redhat.com over 6 years ago

***** Bug 1155773 has been marked as a duplicate of this bug. ***

+ This comment was cloned from Bugzilla #1155411 comment 1 +

#2 Updated by jortel@redhat.com over 6 years ago

The pulp-admin rpm package install command only supports package specification by name. Needs to support epoch, version, release and (probably) arch. Broken (from the CLI perspective) in 2.4.0 by https://bugzilla.redhat.com/show_bug.cgi?id=1004981. 1004981 fixed the handler (and correctly so) but CLI needs to be updated as well.

This is supported by the API (just a CLI issue).

+ This comment was cloned from Bugzilla #1155411 comment 2 +

#3 Updated by dhaval.joshi@nomura.com over 6 years ago

Hello,

can you confirm where exactly it's breaking?, i checked code and tried to pass version='2.7.6' with unit and it worked, but how do i handle that with multiple packages ?

Regards,
DJ

+ This comment was cloned from Bugzilla #1155411 comment 3 +

#4 Updated by dhaval.joshi@nomura.com over 6 years ago

Below is my workaround “pulp_rpm/extensions/admin/rpm_admin_consumer/package.py”

125 def get_content_units(self, kwargs):
126
127 def _unit_dict(unit_name):
128 if '/' in unit_name:
129 parts = unit_name.split('/', 2)
130 if len(parts) < 2:
131 raise ValueError
132 return {'type_id': TYPE_ID_RPM,
133 'unit_key': {'name': parts[0], 'version': parts[1]}}
134 else:
135 return {'type_id': TYPE_ID_RPM,
136 'unit_key': {'name': unit_name}}
137
138 return map(_unit_dict, kwargs['name'])

If you can guide me how to get NEVRA for package, i can apply with that as well.

Thanks,
DJ

+ This comment was cloned from Bugzilla #1155411 comment 4 +

#5 Updated by bmbouter over 6 years ago

I talked to Dhaval in #pulp and he wanted to get input on his posted patch. I didn't know so I'm marking it as needs info to you Jeff.

+ This comment was cloned from Bugzilla #1155411 comment 5 +

#6 Updated by vijaykumar.jain@nomura.com over 6 years ago

In [6]: import rpmUtils

In [7]: print rpmUtils.miscutils.splitFilename('lgtoman-7.6.5.1-1.x86_64.rpm')
('lgtoman', '7.6.5.1', '1', '', 'x86_64')

I have seen someone raising some issues with respect to inconsistent repo naming, but we can definitely get NEVRA from here and use full rpm name for deploy in the CLI.

Let me know if this sounds ok?

+ This comment was cloned from Bugzilla #1155411 comment 6 +

#7 Updated by jortel@redhat.com over 6 years ago

I have been discussing with dhaval via direct email. Providing feedback here for completeness.

No, I would not recommend using that function. I does weird things with
partial names.

EG:

>>> from rpmUtils.miscutils import splitFilename
>>> splitFilename('lgtoman-7.6.5.1-1.x86_64.rpm')
('lgtoman', '7.6.5.1', '1', '', 'x86_64')
>>> splitFilename('lgtoman-7.6.5.1-1.x86_64')
('lgtoman', '7.6.5.1', '1', '', 'x86_64')
>>> splitFilename('lgtoman-7.6.5.1.x86_64')
('lgtoman-7.6.5.1.x86_6', 'lgtoman', '7.6.5.1', '', 'x86_64')
>>> splitFilename('lgtoman')
('lgtoma', 'lgtoma', 'lgtoma', '', 'lgtoman')
>>> splitFilename('lgtoman-1.0')
('lgtoman-1.', 'lgtoman', '1', '', '0')

If you write a function to perform the split, I would suggest putting it
in pulp_rpm.common. Also, I did a quick look and did not find anything
in the pulp_rpm project that you can use for this. Though, it would be
good for you to do a search as well before writing the function just to
double check.

+ This comment was cloned from Bugzilla #1155411 comment 7 +

#8 Updated by vijaykumar.jain@nomura.com over 6 years ago

what about using the function only when path is full filename. we can have any amount of "-"s and "."s in the name which can hinder the parsing functionality.
We can either ask the user to explicitly provide the full rpm and the use the above parsing only when we have full rpm file else, go with the name based approach and if there is a failure then provide available packages in repository matching the input?
pulp-admin -u admin -p admin rpm repo content rpm --repo-id <repoid> --match='filename=myrpm-1.6' --fields name,filename,version

+ This comment was cloned from Bugzilla #1155411 comment 8 +

#9 Updated by bmbouter over 6 years ago

  • Severity changed from Medium to 2. Medium

#10 Updated by bmbouter over 2 years ago

  • Status changed from NEW to CLOSED - WONTFIX

Pulp 2 is approaching maintenance mode, and this Pulp 2 ticket is not being actively worked on. As such, it is being closed as WONTFIX. Pulp 2 is still accepting contributions though, so if you want to contribute a fix for this ticket, please reopen or comment on it. If you don't have permissions to reopen this ticket, or you want to discuss an issue, please reach out via the developer mailing list.

#11 Updated by bmbouter over 2 years ago

  • Tags Pulp 2 added

Please register to edit this issue

Also available in: Atom PDF