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

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