Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1114103

Summary: persistent-cache prerequisite issues
Product: Red Hat Satellite Reporter: Grant Gainey <ggainey>
Component: TransitionsAssignee: Grant Gainey <ggainey>
Status: CLOSED CURRENTRELEASE QA Contact: Lukas Pramuk <lpramuk>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.0.4CC: bbuckingham, cwelton, tlestach
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-09-11 12:25:07 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: 1125243    

Description Grant Gainey 2014-06-27 17:56:00 UTC

Comment 1 Grant Gainey 2014-06-27 18:04:28 UTC
If an entity doesn't have an @prerequisite, it can result in exceptions being thrown.  Also, persistent_maps appears to be order-dependent.

Take host-collections, for example:

===
hammer> import host-collection --csv-file /tmp/exports/system-groups.csv
[ERROR 2014-06-27 18:00:25 Exception] Error: undefined method `keys' for #<Array:0x7f33528536a8>
Error: undefined method `keys' for #<Array:0x7f33528536a8>
[ERROR 2014-06-27 18:00:25 Exception] 

NoMethodError (undefined method `keys' for #<Array:0x7f33528536a8>):
    /root/github/hammer-cli-import/lib/hammer_cli_import/persistentmap.rb:147:in `prune_persistent_maps'
    /root/github/hammer-cli-import/lib/hammer_cli_import/persistentmap.rb:146:in `each'
    /root/github/hammer-cli-import/lib/hammer_cli_import/persistentmap.rb:146:in `prune_persistent_maps'
    /root/github/hammer-cli-import/lib/hammer_cli_import/base.rb:412:in `execute'
    /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:67:in `run'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/../abstract.rb:22:in `run'
    /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/subcommand/execution.rb:11:in `execute'
    /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:67:in `run'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/../abstract.rb:22:in `run'
    /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/subcommand/execution.rb:11:in `execute'
    /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:67:in `run'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/../abstract.rb:22:in `run'
    /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:125:in `run'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/shell.rb:104:in `execute'
    /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:67:in `run'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/../abstract.rb:22:in `run'
    /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/subcommand/execution.rb:11:in `execute'
    /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:67:in `run'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/../abstract.rb:22:in `run'
    /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:125:in `run'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/bin/hammer:100
    /usr/bin/hammer:19:in `load'
    /usr/bin/hammer:19
===

Expected behavior:

===
hammer> import host-collection --csv-file /tmp/exports/system-groups.csv
Host_collection [19->243] already imported.
Host_collection [20->244] already imported.
Host_collection [33->245] already imported.
Host_collection [34->246] already imported.
Host_collection [35->247] already imported.
hammer> 
===

Comment 2 Grant Gainey 2014-06-27 18:08:51 UTC
2c855c30fbcc26f31925f8afc374a3b3151e0778

Comment 3 RHEL Program Management 2014-06-27 18:16:48 UTC
Since this issue was entered in Red Hat Bugzilla, the release flag has been
set to ? to ensure that it is properly evaluated for this release.

Comment 6 Tomas Lestach 2014-09-04 14:24:48 UTC
# hammer import host-collection --csv-file /tmp/exports/system-groups.csv 
[Foreman] username: admin
[Foreman] password for admin: 
Summary
  Created 242 host_collections.
# hammer import host-collection --csv-file /tmp/exports/system-groups.csv 
[Foreman] username: admin
[Foreman] password for admin: 
Summary
  No action taken.

DEVELPER VERIFIED with rubygem-hammer_cli_import-0.10.4-1.1.el6sat.noarch

Comment 7 Bryan Kearney 2014-09-11 12:25:07 UTC
This was delivered with Satellite 6.0 which was released on 10 September 2014.