Bug 729289 - CLI: when scheduling an operation, no error is returned if an invalid operation name is specified
Summary: CLI: when scheduling an operation, no error is returned if an invalid operati...
Status: CLOSED NOTABUG
Alias: None
Product: RHQ Project
Classification: Other
Component: CLI
Version: 3.0.1
Hardware: Unspecified
OS: Unspecified
medium
low vote
Target Milestone: ---
: ---
Assignee: Ian Springer
QA Contact: Mike Foley
URL:
Whiteboard:
Keywords:
Depends On:
Blocks: jon3 rhq41beta
TreeView+ depends on / blocked
 
Reported: 2011-08-09 11:34 UTC by Ondřej Žižka
Modified: 2013-08-06 00:40 UTC (History)
3 users (show)

(edit)
Clone Of:
(edit)
Last Closed: 2011-08-10 19:10:38 UTC


Attachments (Terms of Use)

Description Ondřej Žižka 2011-08-09 11:34:53 UTC
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 11:59:13 UTC
Is it "shutdown"? Why didn't it throw an exception then.
And, "start" did not either.

Comment 2 Ian Springer 2011-08-09 14:49:31 UTC
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 17:51:38 UTC
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 14:42:33 UTC
Thx, that will help.

Comment 5 Ondřej Žižka 2011-08-10 15:55:35 UTC
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 19:10:38 UTC
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.