Bug 620891

Summary: Need CLI script(s) to update connection properties that do not get set during plugin upgrade
Product: [Other] RHQ Project Reporter: John Sanda <jsanda>
Component: PluginsAssignee: John Sanda <jsanda>
Status: CLOSED CURRENTRELEASE QA Contact: Mike Foley <mfoley>
Severity: medium Docs Contact:
Priority: low    
Version: 3.0.0CC: jshaughn, rtimaniy, skondkar
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-06-18 16:03:24 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Screenshot1
none
Screenshot2 none

Description John Sanda 2010-08-03 17:30:06 UTC
Description of problem:
The CLI scripts are to provide a temporary work around for bug 619781. The CLI scripts need to address problems found in upgrading the jboss-as, rhq-agent, and apache plugins. In JON 2.3.1 several snapshot report properties were added to the jboss-as and rhq-agent plugins. Several of those properties are required with default values. Likewise, properties were added to the apache plugin in JON 2.4 that are both required and specify default values.

During plugin upgrade, the expected behavior is such that any resources of the particular types (JBossAS Server, Apache HTTP Server, RHQ Agent) should have those properties added to their plugin configurations and set to their default values. This is not happening and the issue is being tracked separately under bug 619781.

The purpose of this bug is to track the CLI scripts that can be run to update resources that are affected by this bug. Two separate scripts are provided - reset_jboss_agent_props.js and reset_apache_props.js.

These scripts are located in the master branch at rhq/etc/cli-scripts. They can be executed by first logging in through the CLI and then executing the following commands,

$ exec -f reset_jboss_agent_props.js
$ exec -f reset_apache_props.js

There are a handful of different scenarios that need to be tested.

jboss-as/rhq-agent
------------------
2.2 --> 2.3.1
2.2 --> 2.4.0

apache
-------
2.2 --> 2.4.0
2.3.1 --> 2.4.0

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:
After the scripts are run, you should be able to do the following.

1. Go to view the connection properties for an existing JBoss AS server, RHQ agent, or apache server in inventory whose availability is UP (i.e., green)

2. Click on the edit button

3. Click the save button

The save should complete without any errors or warnings.

Additional info:

Comment 1 John Sanda 2010-08-03 17:30:58 UTC
I pushed the latest changes for these scripts which includes the initial commit for the apache script.

commit hash: cd688890537687233af414fbdf785707a98f8718

Comment 3 Sunil Kondkar 2011-08-08 12:52:16 UTC
Tested the upgrade for jboss-as/rhq-agent from 2.2 --> 2.3.1 and from 2.2 --> 2.4.0

For jboss-as/rhq-agent, after upgrade from 2.2 --> 2.3.1 and from 2.2 --> 2.4.0, i tried to execute the 'reset_jboss_agent_props.js' file which is located at:
"https://hudson.qa.jboss.com/hudson/view/Jon-2.x/job/rhq-master/ws/etc/cli-scripts/"

I got below error while executing the 'reset_jboss_agent_props.js' file at CLI:

rhqadmin.193.104:7080$ exec -f /home/skondkar/Downloads/reset_jboss_agent_props.js
sun.org.mozilla.javascript.internal.EcmaError: ReferenceError: "exec" is not defined. (<Unknown source>#108) in <Unknown source> at line number 108
^

Debugged the file and removed 'exec -f' at line number 108 locally. Reexecuted the file at CLI which worked. The edit and save worked for jboss-as/rhq-agent plugin, after upgrade from 2.2 --> 2.3.1 and from 2.2 --> 2.4.0
	
-----------------------

For Apache, after upgrade from 2.2 --> 2.4.0 and 2.3.1 --> 2.4.0, i tried to execute the 'reset_apache_props.js' file which is located at:
"https://hudson.qa.jboss.com/hudson/view/Jon-2.x/job/rhq-master/ws/etc/cli-scripts/"

I got below error while executing the 'reset_apache_props.js' file at CLI:

rhqadmin.193.104:7080$ exec -f /home/skondkar/Downloads/reset_apache_props.js     
sun.org.mozilla.javascript.internal.EvaluatorException: missing ; before statement (<Unknown source>#87) in <Unknown source> at line number 87
^

Debugged the file at line number 87 and found that it has a typo 'functionr'. Changed it in the local copy to 'function' and reexecuted the file which worked.

However, i am getting errors for the properties 'Augeas Module Name' and 'Path To Contain Virtual Hosts Files' after executing the script and edit and save for apache server connection properties.
(Got the same errors after upgrade from 2.2 --> 2.4.0 and 2.3.1 --> 2.4.0. 
Please refer the screenshots.)

Comment 4 Sunil Kondkar 2011-08-08 12:53:28 UTC
Created attachment 517205 [details]
Screenshot1

Comment 5 Sunil Kondkar 2011-08-08 12:54:04 UTC
Created attachment 517206 [details]
Screenshot2

Comment 6 Jay Shaughnessy 2014-06-18 16:03:24 UTC
no longer relevant