Eli Mesika has uploaded a new change for review.

Change subject: core:force bool fence agents options value
......................................................................

core:force bool fence agents options value

This patch fixes a error caused by fence-agents package that broke
backward compatibility.

fence-agents used to accept boolean agent flags as secure or lanplus
either as 'lanplus' or 'lanplus=1' or 'lanplus=true'
Now, we can not pass such options without a true/1 value
This patch fixes the issue by changing those flags in 2 places

1) The default options set by agent implicitly
2) The existing options stored in the fence_agents table

This patch does not address encrypted options and such should be
redefined
This will be clearly communicated via the BZ release notes.

Change-Id: I45f7a245dc01186f85619efd062c6f326c40d095
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1209957
Signed-off-by: emesika <emes...@redhat.com>
---
A packaging/dbscripts/upgrade/03_06_1400_fix_bool_fence_agents_options.sql
M packaging/dbscripts/upgrade/pre_upgrade/0000_config.sql
2 files changed, 15 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/03/41103/1

diff --git 
a/packaging/dbscripts/upgrade/03_06_1400_fix_bool_fence_agents_options.sql 
b/packaging/dbscripts/upgrade/03_06_1400_fix_bool_fence_agents_options.sql
new file mode 100644
index 0000000..c380aa8
--- /dev/null
+++ b/packaging/dbscripts/upgrade/03_06_1400_fix_bool_fence_agents_options.sql
@@ -0,0 +1,14 @@
+--- The fence agents package broke backward compatibility by not supporting 
boolean flags to be provided without
+--- a value. i.e. from now on for example 'lanplus' is not legal while 
'lanplus=1' or 'lanplus=true' is OK
+--- This upgrade script will change all known flags (currently 'secure' and 
'lanplus') to have an explicit value.
+-- force all 'lanplus' in options to be 'lanplus=1'
+update fence_agents set options =  replace(options, 'lanplus=1', 
'TEMP_LANPLUS_EXPR') where not encrypt_options;
+update fence_agents set options =  replace(options, 'lanplus=true', 
'TEMP_LANPLUS_EXPR') where not encrypt_options;
+update fence_agents set options =  replace(options, 'lanplus', 'lanplus=1') 
where not encrypt_options;
+update fence_agents set options =  replace(options, 'TEMP_LANPLUS_EXPR', 
'lanplus=1') where not encrypt_options;
+
+-- force all 'secure' in options to be 'secure=1'
+update fence_agents set options =  replace(options, 'secure=1', 
'TEMP_SECURE_EXPR') where not encrypt_options;
+update fence_agents set options =  replace(options, 'secure=true', 
'TEMP_SECURE_EXPR') where not encrypt_options;
+update fence_agents set options =  replace(options, 'secure', 'secure=1') 
where not encrypt_options;
+update fence_agents set options =  replace(options, 'TEMP_SECURE_EXPR', 
'secure=1') where not encrypt_options;
diff --git a/packaging/dbscripts/upgrade/pre_upgrade/0000_config.sql 
b/packaging/dbscripts/upgrade/pre_upgrade/0000_config.sql
index 03a1d2d..c053cc5 100644
--- a/packaging/dbscripts/upgrade/pre_upgrade/0000_config.sql
+++ b/packaging/dbscripts/upgrade/pre_upgrade/0000_config.sql
@@ -721,7 +721,7 @@
 select 
fn_db_update_config_value('BootstrapMinimalVdsmVersion','4.9','general');
 select fn_db_update_config_value('DBEngine','Postgres','general');
 select fn_db_update_config_value('DefaultTimeZone','(GMT) GMT Standard 
Time','general');
-select 
fn_db_update_config_value('FenceAgentDefaultParams','drac7:privlvl=OPERATOR,lanplus,delay=10;ilo3:lanplus,power_wait=4;ilo4:lanplus,power_wait=4','general');
+select 
fn_db_update_config_value('FenceAgentDefaultParams','drac7:privlvl=OPERATOR,lanplus=1,delay=10;ilo3:lanplus=1,power_wait=4;ilo4:lanplus=1,power_wait=4','general');
 select 
fn_db_update_config_value('FenceAgentDefaultParamsForPPC','ilo3:lanplus=1,cipher=1,privlvl=administrator,power_wait=4,retry_on=2;ilo4:ilanplus=1,cipher=1,privlvl=administrator,power_wait=4,retry_on=2;ipmilan:lanplus=1,cipher=1,privlvl=administrator,power_wait=4,retry_on=2','general');
 select 
fn_db_update_config_value('FenceAgentMapping','drac7=ipmilan,ilo2=ilo,ilo3=ipmilan,ilo4=ipmilan','general');
 select 
fn_db_update_config_value('FenceStartStatusDelayBetweenRetriesInSec','10','general');


-- 
To view, visit https://gerrit.ovirt.org/41103
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I45f7a245dc01186f85619efd062c6f326c40d095
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Eli Mesika <emes...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to