#304 web-data-analysis: fix countme-update
Merged 3 years ago by smooge. Opened 3 years ago by wwoods.
fedora-infra/ wwoods/ansible master  into  master

@@ -11,7 +11,7 @@ 

  PUBLIC_TOTALS_DB=$PUBLIC_DATA_DIR/totals.db

  PUBLIC_TOTALS_CSV=$PUBLIC_DATA_DIR/totals.csv

  

- # Names of the update commands (if not in $PATH..)

+ # Names of the update commands. They should be in PATH somewhere..

  UPDATE_RAWDB=countme-update-rawdb.sh

  UPDATE_TOTALS=countme-update-totals.sh

  
@@ -71,6 +71,11 @@ 

      PATH="$COUNTME_CHECKOUT:$COUNTME_CHECKOUT/scripts:$PATH"

  fi

  

+ # Hardcoding /usr/local/bin here is hacky; should be pulled from pip, but

+ # parsing pip output is nontrivial, and my father always told me:

+ # "Son, life's too damn short write a RFC2822 parser in bash."

+ PATH="$PATH:/usr/local/bin"

+ 

  # Check for required commands

  command -v $UPDATE_RAWDB  >/dev/null || die "can't find '$UPDATE_RAWDB'"

  command -v $UPDATE_TOTALS >/dev/null || die "can't find '$UPDATE_TOTALS'"

So it turns out that pip3 installs scripts to /usr/local/bin and cron
jobs don't have /usr/local/bin in the path.

This commit adds /usr/local/bin to PATH in countme-update.sh.

For Maximum Correctness we should probably get pip to tell us where it
installed countme-update-{rawdb,totals}.sh but this'll work just fine
as long as pip keeps installing scripts to /usr/bin or /usr/local/bin.

Signed-off-by: Will Woods wwoods@redhat.com

Pull-Request has been merged by smooge

3 years ago
Metadata