Code Review
/
releng
/
global-jjb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Fix: Address submodule update issues
[releng/global-jjb.git]
/
shell
/
openstack-cleanup-orphaned-ports.sh
diff --git
a/shell/openstack-cleanup-orphaned-ports.sh
b/shell/openstack-cleanup-orphaned-ports.sh
index
3030fdf
..
c25ba59
100644
(file)
--- a/
shell/openstack-cleanup-orphaned-ports.sh
+++ b/
shell/openstack-cleanup-orphaned-ports.sh
@@
-11,17
+11,24
@@
# Scans OpenStack for orphaned ports
echo "---> Orphaned ports"
# Scans OpenStack for orphaned ports
echo "---> Orphaned ports"
+# shellcheck disable=SC1090
+source ~/lf-env.sh
+
os_cloud="${OS_CLOUD:-vex}"
os_cloud="${OS_CLOUD:-vex}"
+lf-activate-venv --python python3 \
+ python-heatclient \
+ python-openstackclient
+
set -eux -o pipefail
mapfile -t os_ports_ts < <(openstack --os-cloud "$os_cloud" port list \
set -eux -o pipefail
mapfile -t os_ports_ts < <(openstack --os-cloud "$os_cloud" port list \
- -f value \
- -c ID \
- -c status \
- -c created_at \
- | grep -E DOWN \
- | awk -F' ' '{print $1 " " $3}')
+
-f value \
+
-c ID \
+
-c status \
+
-c created_at \
+
| grep -E DOWN \
+
| awk -F' ' '{print $1 " " $3}')
if [ ${#os_ports_ts[@]} -eq 0 ]; then
echo "No orphaned ports found."
if [ ${#os_ports_ts[@]} -eq 0 ]; then
echo "No orphaned ports found."