Bug 816235

Summary: CLI - DiscoveryBoss.importResources(resources) fails when parent resources are not already in inventory.
Product: [Other] RHQ Project Reporter: Filip Brychta <fbrychta>
Component: CLI, UsabilityAssignee: RHQ Project Maintainer <rhq-maint>
Status: NEW --- QA Contact: Mike Foley <mfoley>
Severity: unspecified Docs Contact:
Priority: medium    
Version: 4.4CC: hrupp
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Bug Depends On:    
Bug Blocks: 743405    

Description Filip Brychta 2012-04-25 11:14:21 EDT
Description of problem:
DiscoveryBoss.importResources(resources) doesn't import related parent resources automatically. User is forced to import them manually otherwise importing fails. This could be really time-consuming activity for complex hierarchy. 

Version-Release number of selected component (if applicable):
Version: 4.4.0-SNAPSHOT
Build Number: ca5eecb

How reproducible:
Always

Steps to Reproduce:
1. uninventory all resources
2. use DiscoveryBoss.importResources(resources) to import JBossAS
  
Actual results:
Caused by: java.lang.IllegalStateException: [Warning] Cannot commit resource [Resource[id=25264, uuid=4bcd99f8-57ef-43a8-813f-e837ecfb0664, type={JBossAS5}JBossAS Server, key=/home/testuser/jboss-eap-5.1/jboss-as/server/default, name=EAP localhost:1099 default, parent=dhcp-27-145.brq.redhat.com, version=EAP 5.1.2]] to inventory, because its parent resource [Resource[id=25263, uuid=98c84f72-9252-46f8-b4e4-4fa520a4ab79, type={Platforms}Linux, key=dhcp-27-145.brq.redhat.com, name=dhcp-27-145.brq.redhat.com, parent=<null>, version=Linux 3.3.0-8.fc16.x86_64]] has not yet been committed.

Expected results:
JBossAS is imported
Comment 1 Mike Foley 2012-04-30 12:02:13 EDT
triaged 4/30/2012 by loleary, ccrouch, mfoley