From 44520209862be2f36aecf7944d22720930813e2e Mon Sep 17 00:00:00 2001 From: digimer Date: Fri, 1 Mar 2024 00:02:29 -0500 Subject: [PATCH] When OCF_RESKEY_name isn't set, but OCF_RESOURCE_INSTANCE is, copy it Signed-off-by: digimer --- ocf/alteeve/server | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ocf/alteeve/server b/ocf/alteeve/server index 63776983..a1a89ad3 100755 --- a/ocf/alteeve/server +++ b/ocf/alteeve/server @@ -248,6 +248,18 @@ elsif ((not $anvil->data->{switches}{server}) && ($anvil->data->{environment}{OC }}); } +# In some cases, 'OCF_RESKEY_name' isn't set, but 'OCF_RESOURCE_INSTANCE' is. If this is the case, copy the +# data over. +if ((not $anvil->data->{environment}{OCF_RESKEY_name}) && ($anvil->data->{environment}{OCF_RESOURCE_INSTANCE})) +{ + $anvil->data->{environment}{OCF_RESKEY_name} = $anvil->data->{environment}{OCF_RESOURCE_INSTANCE}; + $anvil->data->{switches}{server} = $anvil->data->{environment}{OCF_RESOURCE_INSTANCE}; + $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { + "environment::OCF_RESKEY_name" => $anvil->data->{environment}{OCF_RESKEY_name}, + "switches::server" => $anvil->data->{switches}{server}, + }}); +} + if (($anvil->data->{switches}{migrate_to}) && (not $anvil->data->{environment}{OCF_RESKEY_CRM_meta_migrate_target})) { $anvil->data->{environment}{OCF_RESKEY_CRM_meta_migrate_target} = $anvil->data->{switches}{migrate_to};