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