X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=jjb%2Fodl-openstack-cleanup-orphaned-nodes.sh;h=df598b473d83eba76ae30b3803f28df1afadfe3d;hb=acb0c7c60dad3e06ddcfb29bcd76a6297c10c128;hp=1b7f0c68e47389c6ab0d7cd2f2d63f12bf48b0f2;hpb=45dda826d667777fa16b4e937bce5e736cdcfa3c;p=releng%2Fbuilder.git diff --git a/jjb/odl-openstack-cleanup-orphaned-nodes.sh b/jjb/odl-openstack-cleanup-orphaned-nodes.sh index 1b7f0c68e..df598b473 100644 --- a/jjb/odl-openstack-cleanup-orphaned-nodes.sh +++ b/jjb/odl-openstack-cleanup-orphaned-nodes.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -l # SPDX-License-Identifier: EPL-1.0 ############################################################################## # Copyright (c) 2017 - 2018 The Linux Foundation and others. @@ -43,22 +43,14 @@ minion_in_jenkins() { # Fetch server list before fetching active minions to minimize race condition # where we might be trying to delete servers while jobs are trying to start -# shellcheck source=/tmp/v/openstack/bin/activate disable=SC1091 -source "/tmp/v/openstack/bin/activate" - # We purposely need word splitting here to create the OS_SERVERS array. # shellcheck disable=SC2207 mapfile -t OS_SERVERS < <(openstack server list -f value -c "Name" | grep -E 'prd|snd') -deactivate - ############################# ## DELETE ORPHANED SERVERS ## ############################# -# shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091 -source "/tmp/v/lftools/bin/activate" - # Search for servers that are not in use by either releng or sandbox silos and # delete them. for server in "${OS_SERVERS[@]}"; do @@ -74,5 +66,3 @@ for server in "${OS_SERVERS[@]}"; do server remove --minutes 15 "$server" fi done - -deactivate