adoroszlai commented on code in PR #3864:
URL: https://github.com/apache/ozone/pull/3864#discussion_r1002989292


##########
hadoop-ozone/dist/src/shell/ozone/ozone-functions.sh:
##########
@@ -2512,6 +2525,23 @@ function ozone_parse_args
           ozone_exit_with_usage 1
         fi
       ;;
+      --validate)
+        shift
+        OZONE_VALIDATE_CLASSPATH=true
+        if [[ "${1}" == "classpath" || "${1}" == "--daemon" ]]; then
+          ((OZONE_PARSE_COUNTER=OZONE_PARSE_COUNTER+1))
+        elif [[ "${1}" == "continue" && "${2}" == "--daemon" ]]; then

Review Comment:
   We should be able to provide options in any order.  Please process 
combination of options (`--validate` and `--daemon`) after the loop has 
completed.
   
   Also, currently only the following (somewhat counterintuitive order) is 
supported:
   
   ```
   $ ozone --validate classpath ozone-manager
   Validating classpath file: 
hadoop-ozone/dist/target/ozone-1.3.0-SNAPSHOT/share/ozone/classpath/ozone-manager.classpath
   ...
   ```
   
   The following commands should also be supported, but are currently failing:
   
   ```
   $ ozone classpath ozone-manager --validate
   unrecognized option
   [main] INFO util.ExitUtil: Exiting with status 1: unrecognized option
   
   $ ozone classpath --validate ozone-manager
   ERROR: Classpath file descriptor 
hadoop-ozone/dist/target/ozone-1.3.0-SNAPSHOT/share/ozone/classpath/--validate.classpath
 is missing
   ```



##########
hadoop-ozone/dist/src/shell/ozone/ozone:
##########
@@ -275,6 +276,10 @@ else
   ozonecmd_case "${OZONE_SUBCMD}" "${OZONE_SUBCMD_ARGS[@]}"
 fi
 
+if [[ "${OZONE_SUBCMD_SUPPORTDAEMONIZATION}" == true && "${OZONE_DAEMON_MODE}" 
=~ ^st(art|op|atus)$ ]] || [[ "${OZONE_SUBCMD}" == classpath ]]; then
+  ozone_validate_classpath
+fi

Review Comment:
   Currently we have conditions for validation in two places: here and in 
`ozone_validate_classpath`.  I'd prefer if all conditions were in the same 
place (probably best in `ozone_validate_classpath` to simplify the `ozone` 
executable a bit).



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to