Bug 629987
Summary: | pakcagegroup add_package and delete_package does not check for actual packages | ||
---|---|---|---|
Product: | [Retired] Pulp | Reporter: | Preethi Thomas <pthomas> |
Component: | z_other | Assignee: | John Matthews <jmatthew> |
Status: | CLOSED CURRENTRELEASE | QA Contact: | Preethi Thomas <pthomas> |
Severity: | high | Docs Contact: | |
Priority: | high | ||
Version: | unspecified | CC: | jmatthew, pkilambi, skarmark, tsanders, whayutin |
Target Milestone: | --- | Keywords: | Triaged |
Target Release: | --- | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2011-08-16 14:01:02 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | |||
Bug Blocks: | 641987 |
Description
Preethi Thomas
2010-09-03 12:55:34 UTC
Fixed. Now it raises exception if the package is not present in the repo. $ git commit src/pulp/server/api/repo.py -m "629987 - Adding a check for existing package in a repo before adding or deleting from package group" Created commit 4093b0d: 629987 - Adding a check for existing package in a repo before adding or deleting from package group 1 files changed, 63 insertions(+), 21 deletions(-) reopening this. It does raises an exception. But would be better if there is more user friendly message. [root@localhost ~]# pulp-admin packagegroup add_package --id=pkggrp1 -n preethi --repoid=f12 "Traceback (most recent call last):\n File \"/usr/lib/python2.6/site-packages/pulp/server/webservices/controllers/base.py\", line 51, in report_error\n return method(self, *args, **kwargs)\n File \"/usr/lib/python2.6/site-packages/pulp/server/webservices/role_check.py\", line 102, in check_roles\n result = f(instance, *fargs, **kw)\n File \"/usr/lib/python2.6/site-packages/pulp/server/webservices/controllers/repositories.py\", line 327, in add_packages_to_group\n return self.ok(api.add_packages_to_group(id, groupid, pkg_names, gtype))\n File \"/usr/lib/python2.6/site-packages/pulp/server/auditing.py\", line 193, in _audit\n result = method(*args, **kwargs)\n File \"/usr/lib/python2.6/site-packages/pulp/server/api/repo.py\", line 608, in add_packages_to_group\n % (groupid, repoid))\nPulpException: u'No PackageGroup with id: pkggrp1 exists in repo f12'\n" My understanding of package groups is that they may reference packages which do not exist in the repo. It's possible to have a repo of only package groups and no packages. The client will look at the aggregate of all repos and the package groups will be able to reference any of the available packages at install time. To keep pulp consistent with this understanding I plan to change the behavior back to as it was. For the delete case we can display an error deleting a package not in the group. This commit changes the behavior back so we can add a package to a group, even if it's not in the repo. http://git.fedorahosted.org/git/?p=pulp.git;a=commit;h=27c0c414549be80aba0c2c0401e0384aabc7585b When deleting a package from a package group, if the package to delete is not in the group we throw an exception. Fixed in the 0.73 release. This will be in 0.74 Included in build 0.74. verified [root@preethi ~]# pulp-admin packagegroup add_package --repoid=f13 --id=preethi -n test Following packages added to group [preethi] in repository [f13]: ['test'] [root@preethi ~]# pulp-admin packagegroup delete_package --repoid=f13 --id=preethi -n test Package [test] deleted from group [preethi] in repository [f13] [root@preethi ~]# pulp-admin packagegroup delete_package --repoid=f13 --id=preethi -n test Unable to delete [test] from group [preethi] in repository [f13] [root@preethi ~]# pulp-admin packagegroup info --repoid=f13 --id=preethi +------------------------------------------+ Package Group Information +------------------------------------------+ Name preethi Id preethi Mandatory packages [] Default packages [u'zsh'] Optional packages [] Conditional packages {} Closing with Community Release 15 pulp-0.0.223-4. |