Fix bash bugs & style problems for codacy

This commit is contained in:
ghubstan 2021-01-19 14:38:22 -03:00
parent 873c661218
commit 93c3735f9c
No known key found for this signature in database
GPG Key ID: E35592D6800A861E
4 changed files with 8 additions and 8 deletions

View File

@ -1,4 +1,4 @@
import sys, json, requests
import sys, requests
# Returns the current BTC price for the given currency_code from a cleartext price service.

View File

@ -16,7 +16,7 @@ printbreak
editpaymentaccountform "$COUNTRY_CODE"
exitoncommandalert $?
cat ${APITEST_SCRIPTS_HOME}/${F2F_ACCT_FORM}
cat "${APITEST_SCRIPTS_HOME}/${F2F_ACCT_FORM}"
printbreak
# Create F2F payment accounts for $COUNTRY_CODE, and get the $CURRENCY_CODE.
@ -60,7 +60,7 @@ while : ; do
break
fi
CURRENT_PRICE=$(getcurrentprice ${CURRENCY_CODE})
CURRENT_PRICE=$(getcurrentprice "${CURRENCY_CODE}")
printdate "Current Price: ${CURRENT_PRICE} ${CURRENCY_CODE}"
if [ "$DIRECTION" = "BUY" ] && [ "$CURRENT_PRICE" -le "$LIMIT_PRICE" ]; then

View File

@ -29,7 +29,7 @@ commandalert() {
if [ "$1" -ne 0 ]
then
printdate "Error: $2" >&2
exit $1
exit "$1"
fi
}
@ -39,7 +39,7 @@ exitoncommandalert() {
# usage: exitoncommandalert <$?>
if [ "$1" -ne 0 ]
then
exit $1
exit "$1"
fi
}
@ -113,7 +113,7 @@ getpaymentaccountform() {
}
editpaymentaccountform() {
FORM_PATH=$1
COUNTRY_CODE=$1
CMD="python3 ${APITEST_SCRIPTS_HOME}/editf2faccountform.py $COUNTRY_CODE"
CMD_OUTPUT=$(${CMD})
commandalert $? "Could not edit payment account form."
@ -146,7 +146,7 @@ createpaymentacct() {
getpaymentaccounts() {
PORT=$1
printcmd "${CLI_BASE} --port=${PORT} getpaymentaccts"
CMD="$CLI_BASE --port="$PORT" getpaymentaccts"
CMD="$CLI_BASE --port=$PORT getpaymentaccts"
CMD_OUTPUT=$(${CMD})
commandalert $? "Could not get payment accounts."
echo "${CMD_OUTPUT}"

View File

@ -31,7 +31,7 @@ printbreak
printdate "Bob & Alice edit their ${COUNTRY_CODE} payment account forms, and renames them to ${F2F_ACCT_FORM}"
editpaymentaccountform "$COUNTRY_CODE"
cat ${APITEST_SCRIPTS_HOME}/${F2F_ACCT_FORM}
cat "${APITEST_SCRIPTS_HOME}/${F2F_ACCT_FORM}"
# Remove the autogenerated json template because we are going to use one created by a python script in the next step.
CMD="rm -v ${APP_HOME}/f2f_*.json"