Merge pull request #698 from darko-poljak/SC2002

Fix SC2002
remotes/origin/4.10
Darko Poljak 6 years ago committed by GitHub
commit 4403392869
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      cdist/conf/explorer/cpu_sockets
  2. 2
      cdist/conf/explorer/machine_type
  3. 2
      cdist/conf/type/__ccollect_source/manifest
  4. 2
      cdist/conf/type/__consul/gencode-remote
  5. 2
      cdist/conf/type/__golang_from_vendor/gencode-remote
  6. 2
      cdist/conf/type/__ssh_authorized_key/explorer/entry
  7. 2
      cdist/conf/type/__ssh_authorized_key/gencode-remote
  8. 2
      cdist/conf/type/__staged_file/gencode-local
  9. 2
      cdist/conf/type/__zypper_service/gencode-remote
  10. 2
      cdist/conf/type/__zypper_service/manifest

@ -30,9 +30,9 @@ case "$os" in
*)
if [ -r /proc/cpuinfo ]; then
sockets="$(grep "physical id" /proc/cpuinfo | sort | uniq | wc -l)"
sockets="$(grep "physical id" /proc/cpuinfo | sort -u | wc -l)"
if [ ${sockets} -eq 0 ]; then
sockets="$(cat /proc/cpuinfo | grep "processor" | wc -l)"
sockets="$(grep -c "processor" /proc/cpuinfo)"
fi
echo "${sockets}"
fi

@ -28,7 +28,7 @@ if [ -d "/proc/vz" -a ! -d "/proc/bc" ]; then
fi
if [ -e "/proc/1/environ" ] &&
cat "/proc/1/environ" | tr '\000' '\n' | grep -Eiq '^container='; then
tr '\000' '\n' < "/proc/1/environ" | grep -Eiq '^container='; then
echo lxc
exit
fi

@ -22,7 +22,7 @@ name="$__object_id"
state="$(cat "$__object/parameter/state")"
source="$(cat "$__object/parameter/source")"
destination="$(cat "$__object/parameter/destination")"
ccollectconf="$(cat "$__object/parameter/ccollectconf" | sed 's,/$,,')"
ccollectconf="$(sed 's,/$,,' "$__object/parameter/ccollectconf")"
sourcedir="$ccollectconf/sources"
basedir="$sourcedir/$name"

@ -39,7 +39,7 @@ version_dir="$versions_dir/$version"
source=$(cat "$version_dir/source")
source_file_name="${source##*/}"
cksum_should=$(cat "$version_dir/cksum" | cut -d' ' -f1,2)
cksum_should=$(cut -d' ' -f1,2 "$version_dir/cksum")
cat << eof
tmpdir=\$(mktemp -d --tmpdir="/tmp" "${__type##*/}.XXXXXXXXXX")

@ -2,7 +2,7 @@
version=$(cat "$__object/parameter/version")
kernel_name=$(cat "$__global/explorer/kernel_name" | tr '[:upper:]' '[:lower:]')
kernel_name=$(tr '[:upper:]' '[:lower:]' < "$__global/explorer/kernel_name")
machine=$(cat "$__global/explorer/machine")
case $machine in
x86_64|amd64)

@ -19,7 +19,7 @@
#
# extract the keytype and base64 encoded key ignoring any options and comment
type_and_key="$(cat "$__object/parameter/key" | tr ' ' '\n' | awk '/^(ssh|ecdsa)-[^ ]+/ { printf $1" "; getline; printf $1 }')"
type_and_key="$(tr ' ' '\n' < "$__object/parameter/key"| awk '/^(ssh|ecdsa)-[^ ]+/ { printf $1" "; getline; printf $1 }')"
# If type_and_key is empty, which is the case with an invalid key, do not grep $file because it results
# in greping everything in file and all entries from file are removed.
if [ -n "${type_and_key}" ]

@ -59,7 +59,7 @@ mkdir "$__object/files"
(
if [ -f "$__object/parameter/option" ]; then
# comma seperated list of options
options="$(cat "$__object/parameter/option" | tr '\n' ',')"
options="$(tr '\n' ',' < "$__object/parameter/option")"
printf '%s ' "${options%*,}"
fi
if [ -f "$__object/parameter/comment" ]; then

@ -74,7 +74,7 @@ fetch_and_prepare_file() {
cat << DONE
verify_cksum() {
cksum_is="\$(cksum "$stage_file" | cut -d' ' -f1,2)"
cksum_should="$(cat "$__object/parameter/cksum" | cut -d' ' -f1,2)"
cksum_should="$(cut -d' ' -f1,2 "$__object/parameter/cksum")"
if [ "\$cksum_is" = "\$cksum_should" ]; then
return 0
else

@ -46,7 +46,7 @@ exp_uri="$(cat "$__object/explorer/service_uri")"
exp_id="$(cat "$__object/explorer/service_id")"
# we need this list to remove ids, but we must do this in reverse order
exp_ids="$(cat "$__object/explorer/service_ids" | rev)"
exp_ids="$(rev "$__object/explorer/service_ids")"
if [ "$uri" = "$exp_uri" ] ; then
state_is="present"

@ -47,7 +47,7 @@ fi
[ "$state_is" = "$state_should" ] && exit 0
# we need this list to remove ids, but we must do this in reverse order
exp_repos="$(cat "$__object/explorer/repo_ids" | rev)"
exp_repos="$(rev "$__object/explorer/repo_ids")"
# boolean parameter
if [ -f "$__object/parameter/remove-all-repos" ]; then

Loading…
Cancel
Save