Bug 680216 - pulp-admin content delete --csv ends with a traceback
Summary: pulp-admin content delete --csv ends with a traceback
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Pulp
Classification: Retired
Component: z_other
Version: unspecified
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: Sprint 21
Assignee: Pradeep Kilambi
QA Contact: Preethi Thomas
URL:
Whiteboard:
Depends On:
Blocks: 563609 verified-to-close
TreeView+ depends on / blocked
 
Reported: 2011-02-24 17:22 UTC by Daniel Mach
Modified: 2011-08-16 12:21 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-08-16 12:09:11 UTC
Embargoed:


Attachments (Terms of Use)

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.


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