Blame SOURCES/bz2008333-gcp-pd-move-gcp-vpc-move-route-dont-fail-due-to-incorrect-rc.patch

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