Bug 1132458 - --summary option on repo list causes an error
Summary: --summary option on repo list causes an error
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Pulp
Classification: Retired
Component: z_other
Version: 2.4 Beta
Hardware: Unspecified
OS: Unspecified
medium
unspecified
Target Milestone: ---
: 2.6.0
Assignee: amacdona@redhat.com
QA Contact: Irina Gulina
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-08-21 11:53 UTC by Irina Gulina
Modified: 2015-02-28 22:15 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-02-28 22:15:49 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Pulp Redmine 491 0 None None None Never

Description Irina Gulina 2014-08-21 11:53:42 UTC
Description of problem:
If there are no repos, an error is returnd on 
>>pulp-admin rpm repo list --summary, -s
and
>>pulp-admin repo list --summary, -s

Version-Release number of selected component (if applicable):
>>rpm -qa | grep pulp-server
pulp-server-2.4.1-0.2.alpha.fc20.noarch


How reproducible:
always, if there are no repos


Steps to Reproduce:

>>pulp-admin -u admin -p admin rpm repo list
+----------------------------------------------------------------------+
                            RPM Repositories
+----------------------------------------------------------------------+

>> pulp-admin -u admin -p admin rpm repo list -s
An unexpected error has occurred. More information can be found in the client
log file ~/.pulp/admin.log.

>> pulp-admin -u admin -p admin rpm repo list --summary
An unexpected error has occurred. More information can be found in the client
log file ~/.pulp/admin.log.



>> pulp-admin -u admin -p admin rpm repo list --all
+----------------------------------------------------------------------+
                            RPM Repositories
+----------------------------------------------------------------------+

+----------------------------------------------------------------------+
                        Other Pulp Repositories
+----------------------------------------------------------------------+

>> pulp-admin -u admin -p admin rpm repo create --repo-id=gena
Successfully created repository [gena]

>> pulp-admin -u admin -p admin rpm repo list
+----------------------------------------------------------------------+
                            RPM Repositories
+----------------------------------------------------------------------+

Id:                  gena
Display Name:        gena
Description:         None
Content Unit Counts: 


>> pulp-admin -u admin -p admin rpm repo list -s
gena  gena

>> pulp-admin -u admin -p admin rpm repo list --summary
gena  gena

pulp-admin -u admin -p admin repo list -s
gena  gena

>> pulp-admin -u admin -p admin rpm repo delete --repo-id=gena
This command may be exited via ctrl+c without affecting the request.


[\]
Running...

Repository [gena] successfully deleted


>> pulp-admin -u admin -p admin repo list
+----------------------------------------------------------------------+
                              Repositories
+----------------------------------------------------------------------+

>> pulp-admin -u admin -p admin repo list -s
An unexpected error has occurred. More information can be found in the client
log file ~/.pulp/admin.log.


Traceback:

>>tail -30 ~/.pulp/admin.log

2014-08-21 11:33:52,972 - ERROR - Client-side exception occurred
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/pulp/client/extensions/core.py", line 478, in run
    exit_code = Cli.run(self, args)
  File "/usr/lib/python2.7/site-packages/okaara/cli.py", line 974, in run
    exit_code = command_or_section.execute(self.prompt, remaining_args)
  File "/usr/lib/python2.7/site-packages/pulp/client/extensions/extensions.py", line 224, in execute
    return self.method(*arg_list, **clean_kwargs)
  File "/usr/lib/python2.7/site-packages/pulp/client/commands/repo/cudl.py", line 337, in run
    self.display_repository_summaries(**kwargs)
  File "/usr/lib/python2.7/site-packages/pulp/client/commands/repo/cudl.py", line 394, in display_repository_summaries
    _default_summary_view(repo_list, self.prompt)
  File "/usr/lib/python2.7/site-packages/pulp/client/commands/repo/cudl.py", line 494, in _default_summary_view
    max_id_width = max(len(r['id']) for r in repo_list)
ValueError: max() arg is an empty sequence
2014-08-21 11:34:01,184 - ERROR - Client-side exception occurred
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/pulp/client/extensions/core.py", line 478, in run
    exit_code = Cli.run(self, args)
  File "/usr/lib/python2.7/site-packages/okaara/cli.py", line 974, in run
    exit_code = command_or_section.execute(self.prompt, remaining_args)
  File "/usr/lib/python2.7/site-packages/pulp/client/extensions/extensions.py", line 224, in execute
    return self.method(*arg_list, **clean_kwargs)
  File "/usr/lib/python2.7/site-packages/pulp/client/commands/repo/cudl.py", line 337, in run
    self.display_repository_summaries(**kwargs)
  File "/usr/lib/python2.7/site-packages/pulp/client/commands/repo/cudl.py", line 394, in display_repository_summaries
    _default_summary_view(repo_list, self.prompt)
  File "/usr/lib/python2.7/site-packages/pulp/client/commands/repo/cudl.py", line 494, in _default_summary_view
    max_id_width = max(len(r['id']) for r in repo_list)
ValueError: max() arg is an empty sequence

Comment 1 amacdona@redhat.com 2014-09-23 21:01:01 UTC
Fixed with https://github.com/pulp/pulp/pull/1173

Comment 2 Chris Duryee 2014-12-23 20:52:45 UTC
fixed in pulp 2.6.0-0.2.beta

Comment 3 Irina Gulina 2014-12-23 23:44:01 UTC
>> rpm -qa | grep pulp-server
pulp-server-2.6.0-0.2.beta.fc20.noarch

>> pulp-admin -u admin -p admin rpm repo create --repo-id test
Successfully created repository [test]

>> pulp-admin repo list --summary
test  test
>> pulp-admin repo list -s
test  test
>> pulp-admin -u admin -p admin rpm repo delete --repo-id test
This command may be exited via ctrl+c without affecting the request.


[\]
Running...

Repository [test] successfully deleted


>> pulp-admin repo list -s
>> pulp-admin repo list --summary

Comment 4 Brian Bouterse 2015-02-28 22:15:49 UTC
Moved to https://pulp.plan.io/issues/491


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