I want to discuss the exit_code of ActionReport, WARNING vs FAILURE.
Currently, I see that the exit_code is always set to FAILURE,
regardless whether the command did what the user tries to do
eg. If i want to create an instance, with an existing node
"dummyNode", the instance is created, but gives this message, with
exit_code "FAILURE"
"message":"*Successfully created instance XYZ in the DAS configuration*,
but failed to create the instance files on node dummyNode
(dummyHost).\n\nThis command requires connecting to host dummyHost using
SSH to complete its operation, but it failed to connect:\n\n Command
execution failed. There was a problem while connecting to
dummyHost:22\n\nPlease verify you have SSH configured correctly on your
system with the proper attributes set on node dummyNode. You may use
update-node-ssh to modify these attributes. See the DAS log file for
more information.\n\nTo complete this operation run the following
command locally on host dummyHost from the GlassFish install location
\/Users\/anilam\/Awork\/V3\/v3\/dist-gf:\n\n asadmin --host
macau2.us.oracle.com --port 4848 create-local-instance --node dummyNode
XYZ",
"command":"Error",
*"exit_code":"FAILURE"*}
Or, If I want to create an instance, with a non-existing node, the
instance cannot be created, (which is expected), and get the following
message, again with an exit_code "FAILURE"
"message":"There is no node named NO-SUCH in this domain.",
"command":"Error",
*"exit_code":"FAILURE"*}
The same applies to delete-instance. Even though the instance is
deleted, the exit_code will be set to "FAILURE" if there is any issue
in the process.
message=*Successfully removed instance XYZ from the DAS configuration*,
but failed to remove the instance files from node dummyNode
(dummyHost).\n\nThis command requires connecting to host dummyHost using
SSH to complete its operation, but it failed to connect:\n\n Command
execution failed. There was a problem while connecting to
dummyHost:22\n\nPlease verify you have SSH configured correctly on your
system with the proper attributes set on node dummyNode. You may use
update-node-ssh to modify these attributes. See the DAS log file for
more information.\n\nTo complete this operation run the following
command locally on host dummyHost from the GlassFish install location
\/Users\/anilam\/Awork\/V3\/v3\/dist-gf:\n\n asadmin
delete-local-instance --node dummyNode XYZ",
"command":"Error",
*"exit_code":"FAILURE"*
Admin Console needs to handle things differently whether the actual
intended action succeeded or not. We need to direct to different pages
depending on the status. Also, once there is failure, we abort any
remaining request to finish the task. With the current design, GUI
cannot behave correctly.
Can we change it, such that WARNING is given instead of FAILURE for
situation where the main purpose of the command has succeeded ?
Is this a bug or by design ?
thanks
Anissa.