Bug 623429 - --type option in packagegroup delete_package
Summary: --type option in packagegroup delete_package
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Pulp
Classification: Retired
Component: z_other
Version: unspecified
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
: ---
Assignee: John Matthews
QA Contact: Preethi Thomas
URL:
Whiteboard:
Depends On:
Blocks: pulp-verified
TreeView+ depends on / blocked
 
Reported: 2010-08-11 19:01 UTC by Preethi Thomas
Modified: 2011-08-16 14:02 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2011-08-16 14:02:57 UTC
Embargoed:


Attachments (Terms of Use)

Description Preethi Thomas 2010-08-11 19:01:36 UTC
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 14:45:53 UTC
status report from server needs to be fixed to report valid error messages.

Comment 2 John Matthews 2010-10-15 19:04:47 UTC
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 16:57:06 UTC
Fixed in 0.75.

Comment 4 Preethi Thomas 2010-10-28 16:01:15 UTC
[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 14:02:57 UTC
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.