Bug 623429 - --type option in packagegroup delete_package
--type option in packagegroup delete_package
Status: CLOSED CURRENTRELEASE
Product: Pulp
Classification: Community
Component: z_other (Show other bugs)
unspecified
All Linux
low Severity medium
: ---
: ---
Assigned To: John Matthews
Preethi Thomas
: Triaged
Depends On:
Blocks: pulp-verified
  Show dependency treegraph
 
Reported: 2010-08-11 15:01 EDT by Preethi Thomas
Modified: 2011-08-16 10:02 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2011-08-16 10:02:57 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Preethi Thomas 2010-08-11 15:01:36 EDT
Description of problem:


--type is stated as an option for pulp packagegroup delete_package. But if you run it without it for a package in the mandatory or optional group, the message says successfully deleted but they are not actually removed.


So if the --type is required to delete a mandatory or optional type, running the command without it should error out with appropriate error message.

[root@preethi pulp]# pulp -u admin -p admin packagegroup delete_package --repoid=f13 --id=pthomas --pkgname=zip-3.0-1.fc13.x86_64.rpm
Package [zip-3.0-1.fc13.x86_64.rpm] deleted from group [pthomas] in repository [f13]
[root@preethi pulp]# pulp -u admin -p admin packagegroup info --id=pthomas --repoid=f13
+-------------------------------------------+
Package Group Information
+-------------------------------------------+

Name                	pthomas                  
Id                  	pthomas                  
Mandatory packages  	[u'zsh-4.3.10-5.fc13.x86_64.rpm', u'zip-3.0-1.fc13.x86_64.rpm']
Default packages    	[u'zlib-1.2.3-23.fc12.i686.rpm', u'zbar-0.10-2.fc13.x86_64.rpm']
Optional packages   	[u'zlib-devel-1.2.3-23.fc12.i686.rpm']
Conditional packages	{}                       

[root@preethi pulp]# pulp -u admin -p admin packagegroup delete_package --repoid=f13 --id=pthomas --pkgname=zip-3.0-1.fc13.x86_64.rpm --type=mandatory
Package [zip-3.0-1.fc13.x86_64.rpm] deleted from group [pthomas] in repository [f13]
[root@preethi pulp]# pulp -u admin -p admin packagegroup info --id=pthomas --repoid=f13
+-------------------------------------------+
Package Group Information
+-------------------------------------------+

Name                	pthomas                  
Id                  	pthomas                  
Mandatory packages  	[u'zsh-4.3.10-5.fc13.x86_64.rpm']
Default packages    	[u'zlib-1.2.3-23.fc12.i686.rpm', u'zbar-0.10-2.fc13.x86_64.rpm']
Optional packages   	[u'zlib-devel-1.2.3-23.fc12.i686.rpm']
Conditional packages	{}                       

[root@preethi pulp]# pulp -u admin -p admin packagegroup delete_package --repoid=f13 --id=pthomas --pkgname=zbar-0.10-2.fc13.x86_64.rpm
Package [zbar-0.10-2.fc13.x86_64.rpm] deleted from group [pthomas] in repository [f13]
[root@preethi pulp]# pulp -u admin -p admin packagegroup info --id=pthomas --repoid=f13
+-------------------------------------------+
Package Group Information
+-------------------------------------------+

Name                	pthomas                  
Id                  	pthomas                  
Mandatory packages  	[u'zsh-4.3.10-5.fc13.x86_64.rpm']
Default packages    	[u'zlib-1.2.3-23.fc12.i686.rpm']
Optional packages   	[u'zlib-devel-1.2.3-23.fc12.i686.rpm']
Conditional packages	{}                       

[root@preethi pulp]# pulp -u admin -p admin packagegroup delete_package --repoid=f13 --id=pthomas --pkgname=zlib-devel-1.2.3-23.fc12.i686.rpm
Package [zlib-devel-1.2.3-23.fc12.i686.rpm] deleted from group [pthomas] in repository [f13]
[root@preethi pulp]# pulp -u admin -p admin packagegroup info --id=pthomas --repoid=f13
+-------------------------------------------+
Package Group Information
+-------------------------------------------+

Name                	pthomas                  
Id                  	pthomas                  
Mandatory packages  	[u'zsh-4.3.10-5.fc13.x86_64.rpm']
Default packages    	[u'zlib-1.2.3-23.fc12.i686.rpm']
Optional packages   	[u'zlib-devel-1.2.3-23.fc12.i686.rpm']
Conditional packages	{}
Comment 1 Pradeep Kilambi 2010-08-17 10:45:53 EDT
status report from server needs to be fixed to report valid error messages.
Comment 2 John Matthews 2010-10-15 15:04:47 EDT
Will be in pulp testing build 0.75


Most of this functionality was addressed with a prior commit, but an issue with conditional package deletes was seen while testing this, below is the fix for the conditional case.

http://git.fedorahosted.org/git/?p=pulp.git;a=commit;h=702cea7ff1f69b0f157dc1008294b146b6d78372



If "--type" is not specified it uses the value "default"


$ sudo pulp-admin -u admin -p admin packagegroup info --repoid vt --id jwm
+------------------------------------------+
          Package Group Information
+------------------------------------------+

Name                	jwm                      
Id                  	jwm                      
Mandatory packages  	[u'mand_pkg1', u'mand_pkg', u'mand_pkg2', u'mand_pkg3']
Default packages    	[u'dflt_pkg1', u'dflt_pkg2']
Optional packages   	[]                       
Conditional packages	{u'cond_pkg1': u'reqpkg'}


$ sudo pulp-admin -u admin -p admin packagegroup delete_package --repoid vt --id jwm -n mand_pkg1
Unable to delete [mand_pkg1] from group [jwm] in repository [vt]


$ sudo pulp-admin -u admin -p admin packagegroup delete_package --repoid vt --id jwm -n mand_pkg1 --type mandatory
Package [mand_pkg1] deleted from group [jwm] in repository [vt]
Comment 3 Jay Dobies 2010-10-20 12:57:06 EDT
Fixed in 0.75.
Comment 4 Preethi Thomas 2010-10-28 12:01:15 EDT
[root@preethi ~]# pulp-admin packagegroup delete_package --repoid=f13_test_relative --id=preethi --name=mand_pkg1
Unable to delete [mand_pkg1] from group [preethi] in repository [f13_test_relative]

[root@preethi ~]# 
[root@preethi ~]# pulp-admin packagegroup delete_package --repoid=f13_test_relative --id=preethi --name=mand_pkg4 --type=mandatory
Package [mand_pkg4] deleted from group [preethi] in repository [f13_test_relative]

[root@preethi ~]# pulp-admin packagegroup delete_package --repoid=f13_test_relative --id=preethi --name=opt_pkg2 
Unable to delete [opt_pkg2] from group [preethi] in repository [f13_test_relative]

[root@preethi ~]# pulp-admin packagegroup delete_package --repoid=f13_test_relative --id=preethi --name=opt_pkg2  --type=optional
Package [opt_pkg2] deleted from group [preethi] in repository [f13_test_relative]

[root@preethi ~]# pulp-admin packagegroup info --repoid=f13_test_relative --id=preethi
+------------------------------------------+
          Package Group Information
+------------------------------------------+

Name                    preethi                  
Id                      preethi                  
Mandatory packages      [u'mand_pkg1', u'mand_pkg2', u'mand_pkg3']
Default packages        [u'preethi', u'dflt_pkg1', u'dflt_pkg2']
Optional packages       [u'opt_pkg1']            
Conditional packages    {u'cond_pkg1': u'reqpkg'}


[root@preethi ~]# pulp-admin packagegroup delete_package --repoid=f13_test_relative --id=preethi --name=preethi
Package [preethi] deleted from group [preethi] in repository [f13_test_relative]

[root@preethi ~]# pulp-admin packagegroup info --repoid=f13_test_relative --id=preethi
+------------------------------------------+
          Package Group Information
+------------------------------------------+

Name                    preethi                  
Id                      preethi                  
Mandatory packages      [u'mand_pkg1', u'mand_pkg2', u'mand_pkg3']
Default packages        [u'dflt_pkg1', u'dflt_pkg2']
Optional packages       [u'opt_pkg1']            
Conditional packages    {u'cond_pkg1': u'reqpkg'}

[root@preethi ~]# pulp-admin packagegroup delete_package --repoid=f13_test_relative --id=preethi --name=cond_pkg1 --type=conditional
Package [cond_pkg1] deleted from group [preethi] in repository [f13_test_relative]


[root@preethi ~]# pulp-admin packagegroup info --repoid=f13_test_relative --id=preethi
+------------------------------------------+
          Package Group Information
+------------------------------------------+

Name                    preethi                  
Id                      preethi                  
Mandatory packages      [u'mand_pkg1', u'mand_pkg2', u'mand_pkg3']
Default packages        [u'dflt_pkg1', u'dflt_pkg2']
Optional packages       [u'opt_pkg1']            
Conditional packages    {}
Comment 5 Preethi Thomas 2011-08-16 10:02:57 EDT
Closing with Community Release 15

pulp-0.0.223-4.

Note You need to log in before you can comment on or make changes to this bug.