You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by ma...@apache.org on 2019/10/02 21:58:47 UTC
[beam] 01/01: Quietly skip cleanup_pubsub in automation script
This is an automated email from the ASF dual-hosted git repository.
markliu pushed a commit to branch markflyhigh-patch-3
in repository https://gitbox.apache.org/repos/asf/beam.git
commit c1ca55f6af37d148a50b2bc3709458910d8625ca
Author: Mark Liu <ma...@apache.org>
AuthorDate: Wed Oct 2 14:58:18 2019 -0700
Quietly skip cleanup_pubsub in automation script
We don't want to fail the automation script if we cleanup topic/subscription that doesn't exist. Make them quietly pass instead.
---
.../src/main/python-release/python_release_automation_utils.sh | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/release/src/main/python-release/python_release_automation_utils.sh b/release/src/main/python-release/python_release_automation_utils.sh
index 09847a8..a715c4c 100644
--- a/release/src/main/python-release/python_release_automation_utils.sh
+++ b/release/src/main/python-release/python_release_automation_utils.sh
@@ -216,10 +216,11 @@ function create_pubsub() {
# None
#######################################
function cleanup_pubsub() {
- # Suppress error since topic/subscription may not exist
- gcloud pubsub topics delete --project=$PROJECT_ID $PUBSUB_TOPIC1 2> /dev/null
- gcloud pubsub topics delete --project=$PROJECT_ID $PUBSUB_TOPIC2 2> /dev/null
- gcloud pubsub subscriptions delete --project=$PROJECT_ID $PUBSUB_SUBSCRIPTION 2> /dev/null
+ # Suppress error and pass quietly if topic/subscription not exists. We don't want the script
+ # to be interrupted in this case.
+ gcloud pubsub topics delete --project=$PROJECT_ID $PUBSUB_TOPIC1 2> /dev/null || true
+ gcloud pubsub topics delete --project=$PROJECT_ID $PUBSUB_TOPIC2 2> /dev/null || true
+ gcloud pubsub subscriptions delete --project=$PROJECT_ID $PUBSUB_SUBSCRIPTION 2> /dev/null || true
}