Skip to content

Commit

Permalink
gcp-pd-move/gcp-vpc-move-route: dont fail failed resources instantly …
Browse files Browse the repository at this point in the history
…(caused by OCF_ERR_CONFIGURED)
  • Loading branch information
oalbrigt committed Sep 30, 2021
1 parent 4c1a928 commit fcd2565
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions heartbeat/gcp-pd-move.in
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def populate_vars():
CONN = googleapiclient.discovery.build('compute', 'v1')
except Exception as e:
logger.error('Couldn\'t connect with google api: ' + str(e))
sys.exit(ocf.OCF_ERR_CONFIGURED)
sys.exit(ocf.OCF_ERR_GENERIC)

for param in PARAMETERS:
value = os.environ.get('OCF_RESKEY_%s' % param, PARAMETERS[param])
Expand All @@ -172,7 +172,7 @@ def populate_vars():
except Exception as e:
logger.error(
'Couldn\'t get instance name, is this running inside GCE?: ' + str(e))
sys.exit(ocf.OCF_ERR_CONFIGURED)
sys.exit(ocf.OCF_ERR_GENERIC)

PROJECT = get_metadata('project/project-id')
if PARAMETERS['disk_scope'] in ['detect', 'regional']:
Expand Down
6 changes: 3 additions & 3 deletions heartbeat/gcp-vpc-move-route.in
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ def validate(ctx):
ctx.conn = googleapiclient.discovery.build('compute', 'v1', credentials=credentials, cache_discovery=False)
except Exception as e:
logger.error('Couldn\'t connect with google api: ' + str(e))
sys.exit(OCF_ERR_CONFIGURED)
sys.exit(OCF_ERR_GENERIC)

ctx.ip = os.environ.get('OCF_RESKEY_ip')
if not ctx.ip:
Expand All @@ -258,7 +258,7 @@ def validate(ctx):
except Exception as e:
logger.error(
'Instance information not found. Is this a GCE instance ?: %s', str(e))
sys.exit(OCF_ERR_CONFIGURED)
sys.exit(OCF_ERR_GENERIC)

ctx.instance_url = '%s/projects/%s/zones/%s/instances/%s' % (
GCP_API_URL_PREFIX, ctx.project, ctx.zone, ctx.instance)
Expand All @@ -273,7 +273,7 @@ def validate(ctx):
idxs = ctx.iproute.link_lookup(ifname=ctx.interface)
if not idxs:
logger.error('Network interface not found')
sys.exit(OCF_ERR_CONFIGURED)
sys.exit(OCF_ERR_GENERIC)
ctx.iface_idx = idxs[0]


Expand Down

0 comments on commit fcd2565

Please sign in to comment.