Blame SOURCES/bz2042070-1-gcp-pd-move-gcp-vpc-move-route-dont-fail-1st-try.patch

3717f3
From fcd2565602146c0b9317d159cecb8935e304c7ce Mon Sep 17 00:00:00 2001
3717f3
From: Oyvind Albrigtsen <oalbrigt@redhat.com>
3717f3
Date: Thu, 30 Sep 2021 10:23:17 +0200
3717f3
Subject: [PATCH] gcp-pd-move/gcp-vpc-move-route: dont fail failed resources
3717f3
 instantly (caused by OCF_ERR_CONFIGURED)
3717f3
3717f3
---
3717f3
 heartbeat/gcp-pd-move.in        | 4 ++--
3717f3
 heartbeat/gcp-vpc-move-route.in | 6 +++---
3717f3
 2 files changed, 5 insertions(+), 5 deletions(-)
3717f3
3717f3
diff --git a/heartbeat/gcp-pd-move.in b/heartbeat/gcp-pd-move.in
3717f3
index e99cc71f88..cbe703c3c5 100644
3717f3
--- a/heartbeat/gcp-pd-move.in
3717f3
+++ b/heartbeat/gcp-pd-move.in
3717f3
@@ -157,7 +157,7 @@ def populate_vars():
3717f3
     CONN = googleapiclient.discovery.build('compute', 'v1')
3717f3
   except Exception as e:
3717f3
     logger.error('Couldn\'t connect with google api: ' + str(e))
3717f3
-    sys.exit(ocf.OCF_ERR_CONFIGURED)
3717f3
+    sys.exit(ocf.OCF_ERR_GENERIC)
3717f3
 
3717f3
   for param in PARAMETERS:
3717f3
     value = os.environ.get('OCF_RESKEY_%s' % param, PARAMETERS[param])
3717f3
@@ -172,7 +172,7 @@ def populate_vars():
3717f3
   except Exception as e:
3717f3
     logger.error(
3717f3
         'Couldn\'t get instance name, is this running inside GCE?: ' + str(e))
3717f3
-    sys.exit(ocf.OCF_ERR_CONFIGURED)
3717f3
+    sys.exit(ocf.OCF_ERR_GENERIC)
3717f3
 
3717f3
   PROJECT = get_metadata('project/project-id')
3717f3
   if PARAMETERS['disk_scope'] in ['detect', 'regional']:
3717f3
diff --git a/heartbeat/gcp-vpc-move-route.in b/heartbeat/gcp-vpc-move-route.in
3717f3
index dac6e4ea8c..6b240c04d0 100644
3717f3
--- a/heartbeat/gcp-vpc-move-route.in
3717f3
+++ b/heartbeat/gcp-vpc-move-route.in
3717f3
@@ -243,7 +243,7 @@ def validate(ctx):
3717f3
     ctx.conn = googleapiclient.discovery.build('compute', 'v1', credentials=credentials, cache_discovery=False)
3717f3
   except Exception as e:
3717f3
     logger.error('Couldn\'t connect with google api: ' + str(e))
3717f3
-    sys.exit(OCF_ERR_CONFIGURED)
3717f3
+    sys.exit(OCF_ERR_GENERIC)
3717f3
 
3717f3
   ctx.ip = os.environ.get('OCF_RESKEY_ip')
3717f3
   if not ctx.ip:
3717f3
@@ -258,7 +258,7 @@ def validate(ctx):
3717f3
   except Exception as e:
3717f3
     logger.error(
3717f3
         'Instance information not found. Is this a GCE instance ?: %s', str(e))
3717f3
-    sys.exit(OCF_ERR_CONFIGURED)
3717f3
+    sys.exit(OCF_ERR_GENERIC)
3717f3
 
3717f3
   ctx.instance_url = '%s/projects/%s/zones/%s/instances/%s' % (
3717f3
       GCP_API_URL_PREFIX, ctx.project, ctx.zone, ctx.instance)
3717f3
@@ -273,7 +273,7 @@ def validate(ctx):
3717f3
   idxs = ctx.iproute.link_lookup(ifname=ctx.interface)
3717f3
   if not idxs:
3717f3
     logger.error('Network interface not found')
3717f3
-    sys.exit(OCF_ERR_CONFIGURED)
3717f3
+    sys.exit(OCF_ERR_GENERIC)
3717f3
   ctx.iface_idx = idxs[0]
3717f3
 
3717f3