diff options
| author | Zuul <zuul@review.opendev.org> | 2025-07-28 12:21:15 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2025-07-28 12:21:15 +0000 |
| commit | 309d2f4c9a3610f5feefeafc1071fe10aa5e3aba (patch) | |
| tree | d2b7bf975a340f1bb2b6c472a5463db58137b20a | |
| parent | 38b652dfdcceb1c7ed0fb24d65436e3b2639f0d6 (diff) | |
| parent | 180721846e02d16fb6d59df1c4f7599cfb16aec6 (diff) | |
| download | kolla-ansible-309d2f4c9a3610f5feefeafc1071fe10aa5e3aba.tar.gz kolla-ansible-309d2f4c9a3610f5feefeafc1071fe10aa5e3aba.zip | |
Merge "Remove egrep usage from scripts"
| -rwxr-xr-x | ansible/roles/container-engine-migration/files/ce-cleanup.sh | 2 | ||||
| -rwxr-xr-x | tests/check-logs.sh | 6 | ||||
| -rwxr-xr-x | tools/cleanup-containers | 4 | ||||
| -rwxr-xr-x | tools/diag | 4 | ||||
| -rwxr-xr-x | tools/pre-commit-hook | 2 |
5 files changed, 9 insertions, 9 deletions
diff --git a/ansible/roles/container-engine-migration/files/ce-cleanup.sh b/ansible/roles/container-engine-migration/files/ce-cleanup.sh index 01269a457..106c5a3d6 100755 --- a/ansible/roles/container-engine-migration/files/ce-cleanup.sh +++ b/ansible/roles/container-engine-migration/files/ce-cleanup.sh @@ -21,7 +21,7 @@ images_to_remove=$(sudo $engine images --filter "label=kolla_version" -q -a) if [ -n "${containers_to_kill}" ]; then volumes_to_remove=$(sudo $engine inspect -f '{{range .Mounts}} {{printf "%s\n" .Name }}{{end}}' ${containers_to_kill} | \ - egrep -v '(^\s*$)' | sort | uniq) + grep -Ev '(^\s*$)' | sort | uniq) echo "Stopping containers..." for container in ${containers_to_kill}; do diff --git a/tests/check-logs.sh b/tests/check-logs.sh index 56f661702..e0f29461f 100755 --- a/tests/check-logs.sh +++ b/tests/check-logs.sh @@ -14,19 +14,19 @@ function check_openstack_log_file_for_level { # $1: file # $2: log level # Filter out false positives from logged config options. - sudo egrep " $2 " $1 | egrep -v "(logging_exception_prefix|rate_limit_except_level)" + sudo grep -E " $2 " $1 | grep -Ev "(logging_exception_prefix|rate_limit_except_level)" } function check_fluentd_log_file_for_level { # $1: file # $2: log level - sudo egrep "\[$2\]:" $1 + sudo grep -E "\[$2\]:" $1 } function check_fluentd_log_file_for_content { # $1: file # $2: content - sudo egrep "$2" $1 + sudo grep -E "$2" $1 } function check_fluentd_missing_logs { diff --git a/tools/cleanup-containers b/tools/cleanup-containers index d2759c598..627d3b878 100755 --- a/tools/cleanup-containers +++ b/tools/cleanup-containers @@ -24,12 +24,12 @@ fi if [ -n "$1" ]; then containers_to_kill=$(sudo $engine ps --filter "label=kolla_version" --format "{{.Names}}" -a | grep -E "$1" | awk '{print $1}') volumes_to_remove=$(sudo $engine inspect -f '{{range .Mounts}} {{printf "%s\n" .Name }}{{end}}' ${containers_to_kill} | \ - egrep -v '(^\s*$)' | sort | uniq) + grep -Ev '(^\s*$)' | sort | uniq) else containers_to_kill=$(sudo $engine ps --filter "label=kolla_version" --format "{{.Names}}" -a) volumes_to_remove=$(sudo $engine inspect -f '{{range .Mounts}} {{printf "%s\n" .Name }}{{end}}' ${containers_to_kill} | \ - egrep -v '(^\s*$)' | sort | uniq) + grep -Ev '(^\s*$)' | sort | uniq) fi if [[ "${containers_to_kill}" =~ "openvswitch_vswitchd" ]] && [[ "${containers_running}" =~ "neutron_openvswitch_agent" ]]; then diff --git a/tools/diag b/tools/diag index 157747343..75a49428a 100755 --- a/tools/diag +++ b/tools/diag @@ -3,7 +3,7 @@ container_engine="${1:-docker}" echo "##### System Identification #####" -egrep -w 'PRETTY_NAME|VERSION_ID' /etc/os-release +grep -Ew 'PRETTY_NAME|VERSION_ID' /etc/os-release echo "##### ${container_engine^} Version #####" $container_engine --version @@ -18,7 +18,7 @@ echo "##### List installed packages, including editables #####" pip list echo "##### Globals.yml file #####" -egrep -w 'kolla_base_distro|openstack_release' /etc/kolla/globals.yml +grep -Ew 'kolla_base_distro|openstack_release' /etc/kolla/globals.yml cat /etc/kolla/globals.yml | grep ^enable_ echo "##### ${container_engine^} Images #####" diff --git a/tools/pre-commit-hook b/tools/pre-commit-hook index 994716107..bf245158d 100755 --- a/tools/pre-commit-hook +++ b/tools/pre-commit-hook @@ -26,7 +26,7 @@ find . -type f echo "=== bashate checks ===" -files=$(egrep -rlI '^#!/(bin/|usr/bin/env )(ba)?sh' .) +files=$(grep -ErlI '^#!/(bin/|usr/bin/env )(ba)?sh' .) [ "$files" ] && (bashate $files || RES=1) echo "=== yaml checks ===" |
