smiklosovic commented on code in PR #1950:
URL: https://github.com/apache/cassandra/pull/1950#discussion_r1052016328


##########
bin/cassandra-conf.sh:
##########
@@ -0,0 +1,168 @@
+#!/bin/sh -x
+
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# A script to include the cassandra.in.sh file, set NUMACTL, and load 
+#          $CASSANDRA_CONF/cassandra-env.sh"
+#
+# Creates a validate_env() function to verify criticla environment vars are set
+# and display them if desired
+
+## Environment variables:
+# ENV_DEBUG: Show all var settings during the validate_env() call.
+# ENV_PRESERVE: A list of environment variables to preserve from being set 
+#       by $CASSANDRA_CONF/cassandra-env.sh"
+# ENV_SHOW: A list of additional environment variables to display during 
validate_env.
+
+## validate_env
+## Args:  Arguments are additional environment variables to show.
+##
+## Validates that required environment variables are set. 
+## Required Environment Vars:
+##      CASSANDRA_INCLUDE
+##      CASSANDRA_HOME
+##      CASSANDRA_LOG_DIR
+## 
+## Environment Vars:
+##      ENV_DEBUG   Enables display of variables.
+##      ENV_SHOW    List of additional variables to display.
+##
+validate_env() {
+    retval=0
+    if [ -n "$ENV_DEBUG" ] ; then
+        echo ""
+        echo "ENVIRONMENT"
+        echo "-----------"
+        echo "PWD=$PWD"
+        echo "CASSANDRA_CONF=$CASSANDRA_CONF"
+    fi
+    
+    if [ "x$CASSANDRA_INCLUDE" = "x" ]; then
+        echo ">>> cassandra.in.sh not found or CASSANDRA_INCLUDE not set" >&2
+        retval=1
+    else
+        if [ -n "$ENV_DEBUG" ] ; then
+            echo "CASSANDRA_INCLUDE=$CASSANDRA_INCLUDE"
+        fi
+    fi
+    
+    if [ "x$CASSANDRA_HOME" = "x" ]; then
+        echo ">>> CASSANDRA_HOME not set" >&2
+        retval=1
+    else
+        if [ -n "$ENV_DEBUG" ] ; then
+            echo "CASSANDRA_HOME=$CASSANDRA_HOME"
+        fi
+    fi
+
+    if [ "x$CASSANDRA_LOG_DIR" = "x" ]; then
+        echo ">>> CASSANDRA_LOG_DIR not set" >&2
+        retval=1
+    else
+        if [ -n "$ENV_DEBUG" ] ; then
+            echo "CASSANDRA_LOG_DIR=$CASSANDRA_LOG_DIR"
+        fi
+    fi
+
+    if [ -n "$ENV_DEBUG" ] ; then

Review Comment:
   should not this be explicitly equal to `1` or `yes` ? 



-- 
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