Bug 680216

Summary: pulp-admin content delete --csv ends with a traceback
Product: [Retired] Pulp Reporter: Daniel Mach <dmach>
Component: z_otherAssignee: Pradeep Kilambi <pkilambi>
Status: CLOSED CURRENTRELEASE QA Contact: Preethi Thomas <pthomas>
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedKeywords: Triaged
Target Milestone: ---   
Target Release: Sprint 21   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-08-16 12:09:11 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: 563609, 647488    

Description Daniel Mach 2011-02-24 17:22:24 UTC
$ pulp-admin content delete --csv=<csv>

Traceback (most recent call last):
  File "pulp/bin/pulp-admin", line 157, in ?
    admin.main()
  File "pulp/client/cli/base.py", line 137, in main
    command.main(args[1:])
  File "pulp/src/pulp/client/core/base.py", line 118, in main
    action.main(args[1:])
  File "pulp/src/pulp/client/core/base.py", line 224, in main
    self.run()
  File "pulp/src/pulp/client/core/content.py", line 270, in run
    if len(pobj['repos']):
UnboundLocalError: local variable 'pobj' referenced before assignment

Comment 1 Pradeep Kilambi 2011-02-24 17:54:40 UTC
hmm I just tried it on mine and works fine. Can you tell me what you have in your csv?

$ sudo pulp-admin content delete --csv=test.csv 
content with filename [skytux-repo-1.0-4.noarch.rpm] is currently associated other repos; Cannot perform delete; skipping
Content with filename [adobe-release-i386-1.0-1.noarch.rpm] could not be found on server; skipping delete
Successfully delete content [test.iso] from pulp server
Content with filename [testme.iso] could not be found on server; skipping delete

Comment 2 Pradeep Kilambi 2011-02-24 18:09:20 UTC
I'm not able to reproduce a case for this, but I can see in what situation it might have happened. Only way this can happen is, you got back a list from server but the csv data does not match any of the pkgs and the object is not set at the end. Which seems odd as server should never have returned a list if you dont have a match. Seems like some corner case, I put in a check for this.

Comment 3 Jeff Ortel 2011-02-25 20:34:11 UTC
build: 0.143

Comment 4 Preethi Thomas 2011-03-02 18:03:08 UTC
verified
[root@preethi upload]# rpm -q pulp
pulp-0.0.143-1.fc14.noarch

[root@preethi upload]# pulp-admin content delete --csv=/root/orphaned.csv 
Successfully delete content [grinder-0.0.81-1.fc14.noarch.rpm] from pulp server
Successfully delete content [pulp-cds-0.0.143-1.fc14.noarch.rpm] from pulp server
[root@preethi upload]# 
[root@preethi upload]# 
[root@preethi upload]# 
[root@preethi upload]# pulp-admin content delete --csv=/root/orphaned.csv 
Content with filename [grinder-0.0.81-1.fc14.noarch.rpm] could not be found on server; skipping delete
Content with filename [pulp-cds-0.0.143-1.fc14.noarch.rpm] could not be found on server; skipping delete

Comment 5 Preethi Thomas 2011-08-16 12:09:11 UTC
Closing with Community Release 15

pulp-0.0.223-4.

Comment 6 Preethi Thomas 2011-08-16 12:21:50 UTC
Closing with Community Release 15

pulp-0.0.223-4.