Merge "import-stx: Avoid divide by zero"
This commit is contained in:
commit
38afa75cc7
4
.gitignore
vendored
4
.gitignore
vendored
@ -12,3 +12,7 @@ doc/build/
|
||||
|
||||
# Release Notes documentation
|
||||
releasenotes/build
|
||||
|
||||
# stx init/config/controller files
|
||||
stx.conf
|
||||
minikube_history.log
|
||||
|
18
import-stx
18
import-stx
@ -41,7 +41,23 @@ if [ ! -f "stx.conf" ]; then
|
||||
fi
|
||||
|
||||
number_of_users () {
|
||||
users | tr ' ' '\n' | sort --uniq | wc -l
|
||||
local count
|
||||
|
||||
count=$(users | tr ' ' '\n' | sort --uniq | wc -l)
|
||||
|
||||
# Add in non-login users that might trigger a parallel build
|
||||
# based on a timer, or other trigger.
|
||||
if getent passwd | grep -q jenkins; then
|
||||
count=$((count+1))
|
||||
fi
|
||||
|
||||
# Always return at least one. i.e. someone is
|
||||
# running this script.
|
||||
if [ $count -le 0 ]; then
|
||||
count=1
|
||||
fi
|
||||
|
||||
echo $count
|
||||
}
|
||||
|
||||
number_of_cpus () {
|
||||
|
1
stx/lib/stx/.gitignore
vendored
Normal file
1
stx/lib/stx/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
__pycache__
|
Loading…
Reference in New Issue
Block a user