Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1125121

Summary: spacecmd package_details fails
Product: [Community] Spacewalk Reporter: Andre Speelmans <redhat>
Component: ServerAssignee: Tomas Lestach <tlestach>
Status: CLOSED NOTABUG QA Contact: Red Hat Satellite QA List <satqe-list>
Severity: high Docs Contact:
Priority: unspecified    
Version: 2.2CC: redhat, tlestach
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-11-11 08:14:46 UTC Type: Bug
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: 1484117    

Description Andre Speelmans 2014-07-31 05:42:20 UTC
Description of problem:
When using spacecmd and trying to get specifics from a package, it fails on every package.

Version-Release number of selected component (if applicable):
2.2.11-1.el6


How reproducible:
Run spacecmd to retrieve package details


Steps to Reproduce:
1. spacecmd package_details 389-ds-base-1.3.1.6-25.el7.x86_64


Actual results (when used with -d option):
DEBUG: : False
DEBUG: Read configuration from /root/.spacecmd/config
DEBUG: Loading configuration section [spacecmd]
DEBUG: Current Configuration: {'server': 'localhost'}
DEBUG: Configuration section [localhost] does not exist
DEBUG: Connecting to https://localhost/rpc/api
DEBUG: Server API Version = 15
DEBUG: Using cached credentials from /root/.spacecmd/localhost/session
DEBUG: Loading cache from /root/.spacecmd/localhost/ssm
DEBUG: /root/.spacecmd/localhost/ssm does not exist
DEBUG: : False
DEBUG: Loading cache from /root/.spacecmd/localhost/systems
DEBUG: Loading cache from /root/.spacecmd/localhost/errata
DEBUG: Loading cache from /root/.spacecmd/localhost/packages_short
DEBUG: Loading cache from /root/.spacecmd/localhost/packages_long
DEBUG: Loading cache from /root/.spacecmd/localhost/packages_by_id
INFO: Connected to https://localhost/rpc/api as system
** Generating package cache **ERROR: 'int' object has no attribute 'append'
Traceback (most recent call last):
  File "/usr/bin/spacecmd", line 139, in <module>
    shell.print_result(shell.onecmd( precmd ), precmd)
  File "/usr/lib64/python2.6/cmd.py", line 219, in onecmd
    return func(arg)
  File "/usr/lib/python2.6/site-packages/spacecmd/package.py", line 51, in do_package_details
    packages.extend(self.do_package_search(' '.join(args), True))
  File "/usr/lib/python2.6/site-packages/spacecmd/package.py", line 138, in do_package_search
    packages = filter_results(self.get_package_names(True),
  File "/usr/lib/python2.6/site-packages/spacecmd/misc.py", line 598, in get_package_names
    self.generate_package_cache()
  File "/usr/lib/python2.6/site-packages/spacecmd/misc.py", line 563, in generate_package_cache
    self.all_packages[longname].append(p.get('id'))
AttributeError: 'int' object has no attribute 'append'



Expected results:
Information about the package


Additional info:
The system spacewalk is running on has recently been updated from 1.7 to 2.2.

Comment 1 Tomas Lestach 2014-11-07 16:57:28 UTC
$ spacecmd package_details 389-ds-base-1.3.1.6-25.el7.x86_64
runs just fine on my Spacewalk nightly machine. The code also looks ok.

If your Spacewalk was updated from an older version, I'd recommend to delete spacecmd cache (as spacecmd-2.2.10 and newer does not work with cache stored by an older spacecmd):
# mv .spacecmd/localhost/ /tmp
and try again.

Does it help?

Comment 2 Andre Speelmans 2014-11-11 07:43:20 UTC
This indeed solved the issue. Thanks for the assistance.

Comment 3 Tomas Lestach 2014-11-11 08:14:46 UTC
(In reply to Andre Speelmans from comment #2)
> This indeed solved the issue. Thanks for the assistance.

Great! Thank you for the information.


Closing the bug.

Comment 4 Eric Herget 2017-09-28 18:11:12 UTC
This BZ closed some time during 2.5, 2.6 or 2.7.  Adding to 2.7 tracking bug.