From 8a80562c03a6f7972fd92f996b8ce1c822055f89 Mon Sep 17 00:00:00 2001 From: Mitch Harding Date: Mon, 18 Mar 2024 12:50:53 -0400 Subject: [PATCH] CASMPET-6925: Fix shellcheck errors, add missing copyright headers (#571) * CASMPET-6925: Remove pyc files that accidentally got comitted; prevent new ones from sneaking in (cherry picked from commit 96e74069cd8da0ed87a0027d0446f47c17cd0116) * CASMPET-6925: Add missing copyright headers (cherry picked from commit 78ceb2fab9bcf548aaf050557c1c5f4774461e8e) * CASMPET-6925: Fix shellcheck errors (cherry picked from commit 5b1c3147265b20f28d7edf028c82820adb60d3e5) --- .gitignore | 5 ++++ goss-testing/scripts/ceph-service-status.sh | 24 +++++++++++++++++- .../check_goss_k8s_pods_ips_in_nmn_pool.sh | 23 +++++++++++++++++ .../scripts/k8s_kyverno_pods_running.sh | 4 +-- .../lib/__pycache__/__init__.cpython-37.pyc | Bin 147 -> 0 bytes .../data_json_parser.cpython-37.pyc | Bin 1132 -> 0 bytes .../scripts/python/lib/data_json_parser.pyc | Bin 1469 -> 0 bytes goss-testing/scripts/velero_backups_check.sh | 4 +-- 8 files changed, 55 insertions(+), 5 deletions(-) create mode 100644 .gitignore delete mode 100644 goss-testing/scripts/python/lib/__pycache__/__init__.cpython-37.pyc delete mode 100644 goss-testing/scripts/python/lib/__pycache__/data_json_parser.cpython-37.pyc delete mode 100644 goss-testing/scripts/python/lib/data_json_parser.pyc diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..3b242c71 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + diff --git a/goss-testing/scripts/ceph-service-status.sh b/goss-testing/scripts/ceph-service-status.sh index fb696b0c..bc1cdf97 100755 --- a/goss-testing/scripts/ceph-service-status.sh +++ b/goss-testing/scripts/ceph-service-status.sh @@ -1,5 +1,27 @@ #!/bin/bash -# Copyright 2021 Hewlett Packard Enterprise Development LP +# +# MIT License +# +# (C) Copyright 2021-2024 Hewlett Packard Enterprise Development LP +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR +# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +# OTHER DEALINGS IN THE SOFTWARE. +# # Default values verbose=false diff --git a/goss-testing/scripts/check_goss_k8s_pods_ips_in_nmn_pool.sh b/goss-testing/scripts/check_goss_k8s_pods_ips_in_nmn_pool.sh index 8f3514a4..2e016a83 100755 --- a/goss-testing/scripts/check_goss_k8s_pods_ips_in_nmn_pool.sh +++ b/goss-testing/scripts/check_goss_k8s_pods_ips_in_nmn_pool.sh @@ -1,4 +1,27 @@ #!/bin/bash +# +# MIT License +# +# (C) Copyright 2023-2024 Hewlett Packard Enterprise Development LP +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR +# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +# OTHER DEALINGS IN THE SOFTWARE. +# out=$(cray sls search networks list --name NMN --format json 2>&1) if [ "$?" -eq 0 ]; then diff --git a/goss-testing/scripts/k8s_kyverno_pods_running.sh b/goss-testing/scripts/k8s_kyverno_pods_running.sh index b468da67..aa56482e 100644 --- a/goss-testing/scripts/k8s_kyverno_pods_running.sh +++ b/goss-testing/scripts/k8s_kyverno_pods_running.sh @@ -2,7 +2,7 @@ # # MIT License # -# (C) Copyright 2022 Hewlett Packard Enterprise Development LP +# (C) Copyright 2022, 2024 Hewlett Packard Enterprise Development LP # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), @@ -46,7 +46,7 @@ rc=$? if [[ ${rc} -ne 0 ]] then # Split into two echo commands for code readability - echo -n "ERROR: Command pipeline failed (return code $?): " 1>&2 + echo -n "ERROR: Command pipeline failed (return code $rc): " 1>&2 echo "kubectl get pods -n kyverno -o json | jq '[.items[] | select(.metadata.labels.app == \"kyverno\").status.containerStatuses[0].state.running] | length'" 1>&2 echo "FAIL" exit 10 diff --git a/goss-testing/scripts/python/lib/__pycache__/__init__.cpython-37.pyc b/goss-testing/scripts/python/lib/__pycache__/__init__.cpython-37.pyc deleted file mode 100644 index 5e10a900c174440e7cd33160aa053f3dc4f7beb4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 147 zcmZ?bVgQ1T+9%>c^kWbK1B^h10}vOp0ErZaUFKPxr4q*y;azqmNQB()gGEKV-UECA94l_eSZdHOk-N&4~enR%Hd@$q^EmA5!- Ra`RJ4b5iX<=6(iZ1^}cWB`p8| diff --git a/goss-testing/scripts/python/lib/__pycache__/data_json_parser.cpython-37.pyc b/goss-testing/scripts/python/lib/__pycache__/data_json_parser.cpython-37.pyc deleted file mode 100644 index 832f7dfc96f077b3b527be1f4680f28abfd99f7c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1132 zcmb_c&2AGh5VpNP*`(Wuwh$4C6StJM;lKri5CT-Bf+{FTMT;tHSv$$5`&X|ck}5r= zcX)*K$dM~gz%%&DiC5@}nJo!@04&Y;^LXZ)@vObi8U)7odq4SRjgVisSPTomQ;>21 zN)SO4lG1=u#4KR}t7a>(UJ_vm`ZUL&lAV+@C z0BZwnCwqsa@>s!@VDCuB{SDbjhni-g;!N}2D2sHQXZsP_7h_pl3oMcZR1m1g5lmR; zG=OT5$#^2v;a-_%m#uD^>28!~y|`a?(Y!MRd&K?{IxyEko`aM>Kxs0kf?m)m;cSZ9 z()N@Ltr`8Ye#W#jcc-k{tsO!?-jW0Ifxv!k?p?sly*}!Cr5oc1u;anWH_t3UY`!wJ zE~rv~>vJD5bmBd%8vj;@q>5b~Z=n~&-aW(otKb1yrgj^;1!A?y)Q+J}VEBraz`5=H z)02}>l&3|U$iPd(=s@=6 zIH={HhPz-gc3#NL*!VGwo#de~wIZBUz&@6f($umjdj%k<=XxL&LgS>Njt0gJ3kVhg zy1b4{-EoXv%A^-Gu?&u!ya@HcSdh(FKo_`IY~P4lhmU-@+a2Vo?53eQ{@i_|@}Z1$ z+3n|L$+av2mXV4Jn2U)XG)8IVK#VA4SbAB=kldBzd6I`nkTvHop z!*_8Tq{NHu(Q1v1X&7gmci`!9cu{(!fK#E5@=)RRuYA=lK!%B-ajNI1R&d8hwT24+ j7T0oO6BQ;l-s7uMpCD<8c7Ma89&5He=F$e7+Gl?NiJ%;C diff --git a/goss-testing/scripts/python/lib/data_json_parser.pyc b/goss-testing/scripts/python/lib/data_json_parser.pyc deleted file mode 100644 index 3cc93b97d86895c895222b70a2cbd6516c7c592d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1469 zcmb_b%Wl(95S@GTbRH$71saf8AQl$tgB5QfM5`_UMZ#GWf~qTHJBeM#PI7NVDkZCS z$D)7Gzd_=E_yCxhI6nJ$gUi|Ux5I9iNMEOKnySx&=nv^ zmk>+nO7j#k-_aNLev!kogNc-aDx*+4Oxgo#nTY2ukMP1>eRX}iXKqtj$v zltkleDryTsfT@VAv#_w438ny15$1ArxCF=8&i5baSc!WAOj3sa5?Cuxf!PtW zm9bUNVUc4+LR5u02bf&3#e%4oS;Sbgsq&}kIHRt^>~Z$V;mHmxmdV!XaEKKw)e?ag z&bx)%S{-;S>7JeFM=RuZ^O$Q6qPP3GR)~OcgzPkbY?&v}2@vLMriqXb77Y znaL&r$Mw?TD2xNHY3O=R&<|$pNIyqM