Bug 729289 - CLI: when scheduling an operation, no error is returned if an invalid operation name is specified
CLI: when scheduling an operation, no error is returned if an invalid operati...
Status: CLOSED NOTABUG
Product: RHQ Project
Classification: Other
Component: CLI (Show other bugs)
3.0.1
Unspecified Unspecified
medium Severity low (vote)
: ---
: ---
Assigned To: Ian Springer
Mike Foley
:
Depends On:
Blocks: jon3 rhq41beta
  Show dependency treegraph
 
Reported: 2011-08-09 07:34 EDT by Ondřej Žižka
Modified: 2013-08-05 20:40 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2011-08-10 15:10:38 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Ondřej Žižka 2011-08-09 07:34:53 EDT
STR:

1) Inventorize EAP 5.1.1
2) In CLI, find AS
3) Run stop operation - 
  OperationManager.scheduleResourceOperation(  as.id, "stop", 0, 1, 0, 2*60*1000, new Configuration(), "JBoss AS stop test" );

The operation does not appear in GUI;
And nothing happens (EAP runs on).

--------------------------------------------------------------------

rhqadmin@stacks1.mw.lab.eng.bos.redhat.com:7080$ as
Resource:
                         id: 11043
                       name: stacks2.mw.lab.eng.bos.redhat.com:1099 all
                    version: 5.1.1
        currentAvailability: UP
               resourceType: JBossAS Server

rhqadmin@stacks1.mw.lab.eng.bos.redhat.com:7080$     var sch = OperationManager.scheduleResourceOperation(  as.id, "stop", 0, 1, 0, 2*60*1000, new Configuration(), "JBoss AS stop test" );

rhqadmin@stacks1.mw.lab.eng.bos.redhat.com:7080$ sch
ResourceOperationSchedule:
        resource: Resource[id=11043, type=JBossAS Server, key=/root/eap/server/all, name=stacks2.mw.lab.eng.bos.redhat.com:1099 all, parent=stacks2.mw.lab.eng.bos.redhat.com, version=5.1.1]
Comment 1 Ondřej Žižka 2011-08-09 07:59:13 EDT
Is it "shutdown"? Why didn't it throw an exception then.
And, "start" did not either.
Comment 2 Ian Springer 2011-08-09 10:49:31 EDT
Yes, it's "shutdown". Here are the ops defined in the plugin descriptor:

        <operation name="start" displayName="Start"
                   description="Start this application server. The script used is specified in the Operations group of connection properties. This operation will fail if the server is already started.">
          <results><c:simple-property name="operationResult" description="Outcome of starting the server."/></results>
        </operation>

        <operation name="shutdown" displayName="Shut Down"
                   description="Shut down this application server via script or JMX, depending on the settings in the Operations and Advanced groups of connection properties. This operation will fail if the server is already shut down.">
          <results><c:simple-property name="operationResult" description="Outcome of shutting down the server."/></results>
        </operation>

        <operation name="restart" displayName="Restart"
                   description="Shut down (if started) and then start this application server.">
          <results><c:simple-property name="operationResult" description="Outcome of restarting the server."/></results>
        </operation>

I agree. it should have thrown an "Unknown operation 'stop'." exception.
Comment 3 Ian Springer 2011-08-09 13:51:38 EDT
scheduleResourceOperation() and scheduleGroupOperation() now validate that the specified operation name and parameters are valid for the specified Resource. If not, they throw an IllegalArgumentException - [master f8c0c68].
Comment 4 Ondřej Žižka 2011-08-10 10:42:33 EDT
Thx, that will help.
Comment 5 Ondřej Žižka 2011-08-10 11:55:35 EDT
Setting priority to low since it turned to be an ID-10-T error (I copied a script from somewhere without checking rhq-plugin.xml).
Can be closed, as far as I am concerned.
Comment 6 Mike Foley 2011-08-10 15:10:38 EDT
closing, per bug loggers ID-10-T comment (user error)

Note You need to log in before you can comment on or make changes to this bug.