Bug 1130162

Summary: Unable to uninstall remote agent via CLI without agent name property
Product: [JBoss] JBoss Operations Network Reporter: Jeeva Kandasamy <jkandasa>
Component: CLIAssignee: Michael Burman <miburman>
Status: CLOSED CURRENTRELEASE QA Contact: Sunil Kondkar <skondkar>
Severity: high Docs Contact:
Priority: unspecified    
Version: JON 3.3.0CC: skondkar, tsegismo
Target Milestone: ER03   
Target Release: JON 3.3.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-12-11 14:01:05 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: 1070242    
Attachments:
Description Flags
server and cli log none

Description Jeeva Kandasamy 2014-08-14 13:08:44 UTC
Created attachment 926775 [details]
server and cli log

Description of problem:
Unable to uninstall remote agent via CLI without agent name property. 
To get installed status, running status we never use agent name and we use agent installation path. But only for uninstall there is option to provide agent installed location and without agent name it's failed to uninstalled. 

Version-Release number of selected component (if applicable):
JBoss Operations Network
Version : 3.3.0.DR01
Build Number : 6468454:dda0a47
GWT Version : 2.5.0
SmartGWT Version : 3.0p

How reproducible:
always

Steps to Reproduce:
1. Install a remote agent via CLI or GUI
2. Uninstall the same agent via CLI with the following commands,

rhqadmin.jonqe.lab.eng.bos.redhat.com:7080$ rbi
RemoteAccessInfo:
	     agentName: 
	          host: jeeva-baseline-pup.bc.jonqe.lab.eng.bos.redhat.com
	hostAuthorized: false
	           key: 
	      password: abc
	          port: 22
	    rememberMe: false
	          user: abc

rhqadmin.jonqe.lab.eng.bos.redhat.com:7080$ RemoteInstallManager.uninstallAgent(rbi)


Error:
javax.ejb.EJBException: [Warning] java.lang.IllegalArgumentException: Agent [null] does not have a known install location. For security purposes, the uninstall will not be allowed. You will have to manually uninstall it from that machine.
RemoteInstallManager.uninstallAgent(rbi) 
^




Additional info: Server log and agent log is attached.

Comment 3 Michael Burman 2014-09-02 22:21:31 UTC
Fixed in master:

commit 1032ab527f12ca72507cf9f4a5431a8b77d501d6
Author: Michael Burman <miburman>
Date:   Tue Sep 2 00:06:24 2014 +0300

    [BZ 1130162] Allow uninstallation to occur with installPath, like stop/start operations. If name is provided, use that information to verify in

Comment 4 Thomas Segismont 2014-09-10 15:52:20 UTC
Cherry-picked over to release/jon3.3.x

commit 561ce97dee99c63e9ab2a585d604db6e91c4f315
Author: Michael Burman <miburman>
Date:   Tue Sep 2 00:06:24 2014 +0300

    [BZ 1130162] Allow uninstallation to occur with installPath, like stop/start operations. If name is provided, use that information to verify information like bef
    
    (cherry picked from commit 1032ab527f12ca72507cf9f4a5431a8b77d501d6)
    Signed-off-by: Thomas Segismont <tsegismo>

Comment 5 Simeon Pinder 2014-09-17 02:49:28 UTC
Moving to ON_QA as available for test with the following brew build:
https://brewweb.devel.redhat.com//buildinfo?buildID=385149

Comment 6 Sunil Kondkar 2014-09-19 11:49:27 UTC
Verified on version : 3.3.0.ER03 build Number :4aefe39:44e33a4

Verified that remote agent is uninstalled successfully via CLI without agent name property :

RemoteInstallManager.uninstallAgent(rbi,agentPath)