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.
2.2 --> 2.3.1
2.2 --> 2.4.0
2.2 --> 2.4.0
2.3.1 --> 2.4.0
Version-Release number of selected component (if applicable):
Steps to Reproduce:
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.
I pushed the latest changes for these scripts which includes the initial commit for the apache script.
commit hash: cd688890537687233af414fbdf785707a98f8718
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:
I got below error while executing the 'reset_jboss_agent_props.js' file at CLI:
email@example.com:7080$ exec -f /home/skondkar/Downloads/reset_jboss_agent_props.js
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:
I got below error while executing the 'reset_apache_props.js' file at CLI:
firstname.lastname@example.org:7080$ exec -f /home/skondkar/Downloads/reset_apache_props.js
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.)
Created attachment 517205 [details]
Created attachment 517206 [details]
no longer relevant