Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some linter warnings, part 11 #267

Merged
merged 9 commits into from
Oct 20, 2017
6 changes: 3 additions & 3 deletions monasca-agent-collector/start.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/ash
# shellcheck shell=dash
# (C) Copyright 2017 Hewlett Packard Enterprise Development LP

set -x
Expand All @@ -9,7 +10,7 @@ USER_PLUGINS="/plugins.d"
AGENT_CONF="/etc/monasca/agent"
AGENT_PLUGINS="$AGENT_CONF/conf.d"

if [ "$KEYSTONE_DEFAULTS_ENABLED" == "true" ]; then
if [ "$KEYSTONE_DEFAULTS_ENABLED" = "true" ]; then
export OS_AUTH_URL=${OS_AUTH_URL:-"http://keystone:35357/v3/"}
export OS_USERNAME=${OS_USERNAME:-"monasca-agent"}
export OS_PASSWORD=${OS_PASSWORD:-"password"}
Expand All @@ -29,8 +30,7 @@ template () {
}

if [ "$HOSTNAME_FROM_KUBERNETES" = "true" ]; then
AGENT_HOSTNAME=$(python /kubernetes_get_host.py)
if [ $? != 0 ]; then
if AGENT_HOSTNAME=$(python /kubernetes_get_host.py); then
echo "Error getting hostname from Kubernetes"
return 1
fi
Expand Down
6 changes: 3 additions & 3 deletions monasca-agent-forwarder/start.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
#!/bin/ash
# shellcheck shell=dash
# (C) Copyright 2017 Hewlett Packard Enterprise Development LP

set -x

AGENT_CONF="/etc/monasca/agent"

if [ "$KEYSTONE_DEFAULTS_ENABLED" == "true" ]; then
if [ "$KEYSTONE_DEFAULTS_ENABLED" = "true" ]; then
export OS_AUTH_URL=${OS_AUTH_URL:-"http://keystone:35357/v3/"}
export OS_USERNAME=${OS_USERNAME:-"monasca-agent"}
export OS_PASSWORD=${OS_PASSWORD:-"password"}
Expand All @@ -23,8 +24,7 @@ template () {
}

if [ "$HOSTNAME_FROM_KUBERNETES" = "true" ]; then
AGENT_HOSTNAME=$(python /kubernetes_get_host.py)
if [ $? != 0 ]; then
if AGENT_HOSTNAME=$(python /kubernetes_get_host.py); then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That seems a bit wrong ? In previous code you had != but now you have =

echo "Error getting hostname from Kubernetes"
return 1
fi
Expand Down