[luci] Additional fix for support for missing fence devices
by Jan Pokorný
commit 0646318956ad67769ae373c9a5a63c04cf3d255a
Author: Jan Pokorný <jpokorny(a)redhat.com>
Date: Mon Oct 7 18:28:30 2013 +0200
Additional fix for support for missing fence devices
Correct situation with FA symlinks is like this:
* ilo aliases: ilo2
* ipmilan aliases: idrac, ilo3, ilo4, imm
Resolves: rhbz#917747
Signed-off-by: Jan Pokorný <jpokorny(a)redhat.com>
luci/templates/fence_devices.html | 136 +++++++++++++++++++++++--------------
luci/validation/validate_fence.py | 4 +-
2 files changed, 88 insertions(+), 52 deletions(-)
---
diff --git a/luci/templates/fence_devices.html b/luci/templates/fence_devices.html
index 5d4561d..a47d43c 100644
--- a/luci/templates/fence_devices.html
+++ b/luci/templates/fence_devices.html
@@ -2005,13 +2005,6 @@
</td>
</tr>
<tr>
- <td>IP Port (optional)</td>
- <td>
- <input name="ipport" type="text" class="text"
- py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('ipport')} or {}"/>
- </td>
- </tr>
- <tr>
<td>Login</td>
<td>
<input name="login" type="text" class="text"
@@ -2035,45 +2028,70 @@
</td>
</tr>
<tr>
- <td>Power Wait (seconds)</td>
+ <td>Authentication Type</td>
<td>
- <input type="text" class="text" name="power_wait"
- py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('power_wait')} or {}"/>
+ <select name="auth" class="fencedevformselect">
+ <option value=""
+ py:attrs="(not cur_fencedev or not cur_fencedev.getAttribute('auth')) and {'selected':'selected'} or {}">None</option>
+ <option value="password"
+ py:attrs="cur_fencedev and cur_fencedev.getAttribute('auth') == 'password' and {'selected':'selected'} or {}">Password</option>
+ <option value="md5"
+ py:attrs="cur_fencedev and cur_fencedev.getAttribute('auth') == 'md5' and {'selected':'selected'} or {}">MD5</option>
+ </select>
</td>
</tr>
<tr>
- <td>Delay (seconds)</td>
+ <td>Use Lanplus</td>
<td>
- <input name="delay" type="text" class="text"
- py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('delay')}"/>
+ <input name="lanplus" type="checkbox" class="checkbox"
+ py:attrs="cur_fencedev and cur_fencedev.getAttribute('lanplus') and {'checked':'checked'} or {}"/>
</td>
</tr>
<tr>
- <td>Power Timeout (seconds)</td>
+ <td>Ciphersuite to use</td>
<td>
- <input type="text" class="text" name="power_timeout"
- py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('power_timeout')} or {}"/>
+ <input name="cipher" type="text" class="text"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('cipher')} or {}"/>
</td>
</tr>
<tr>
- <td>Shell Timeout (seconds)</td>
+ <td>Privilege Level</td>
<td>
- <input type="text" class="text" name="shell_timeout"
- py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('shell_timeout')} or {}"/>
+ <py:with vars="privlvl = cur_fencedev and cur_fencedev.getAttribute('privlvl')">
+ <select name="privlvl">
+ <option value=""
+ py:attrs="not privlvl and {'selected':'selected'} or {}">Default</option>
+ <option value="CALLBACK"
+ py:attrs="privlvl and privlvl.upper() == 'CALLBACK' and {'selected':'selected'} or {}">CALLBACK</option>
+ <option value="USER"
+ py:attrs="privlvl and privlvl.upper() == 'USER' and {'selected':'selected'} or {}">USER</option>
+ <option value="OPERATOR"
+ py:attrs="privlvl and privlvl.upper() == 'OPERATOR' and {'selected':'selected'} or {}">OPERATOR</option>
+ <option value="ADMINISTRATOR"
+ py:attrs="privlvl and privlvl.upper() == 'ADMINISTRATOR' and {'selected':'selected'} or {}">ADMINISTRATOR</option>
+ </select>
+ </py:with>
</td>
</tr>
<tr>
- <td>Login Timeout (seconds)</td>
+ <td>IPMI Operation Timeout</td>
<td>
- <input type="text" class="text" name="login_timeout"
- py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('login_timeout')} or {}"/>
+ <input name="timeout" type="text" class="text"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('timeout')}"/>
</td>
</tr>
<tr>
- <td>Times to Retry Power On Operation</td>
+ <td>Power Wait (seconds)</td>
<td>
- <input type="text" class="text" name="retry_on"
- py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('retry_on')} or {}"/>
+ <input type="text" class="text" name="power_wait"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('power_wait')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Delay (seconds)</td>
+ <td>
+ <input name="delay" type="text" class="text"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('delay')}"/>
</td>
</tr>
</table>
@@ -2110,13 +2128,6 @@
</td>
</tr>
<tr>
- <td>IP Port (optional)</td>
- <td>
- <input name="ipport" type="text" class="text"
- py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('ipport')} or {}"/>
- </td>
- </tr>
- <tr>
<td>Login</td>
<td>
<input name="login" type="text" class="text"
@@ -2140,45 +2151,70 @@
</td>
</tr>
<tr>
- <td>Power Wait (seconds)</td>
+ <td>Authentication Type</td>
<td>
- <input type="text" class="text" name="power_wait"
- py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('power_wait')} or {}"/>
+ <select name="auth" class="fencedevformselect">
+ <option value=""
+ py:attrs="(not cur_fencedev or not cur_fencedev.getAttribute('auth')) and {'selected':'selected'} or {}">None</option>
+ <option value="password"
+ py:attrs="cur_fencedev and cur_fencedev.getAttribute('auth') == 'password' and {'selected':'selected'} or {}">Password</option>
+ <option value="md5"
+ py:attrs="cur_fencedev and cur_fencedev.getAttribute('auth') == 'md5' and {'selected':'selected'} or {}">MD5</option>
+ </select>
</td>
</tr>
<tr>
- <td>Delay (seconds)</td>
+ <td>Use Lanplus</td>
<td>
- <input name="delay" type="text" class="text"
- py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('delay')}"/>
+ <input name="lanplus" type="checkbox" class="checkbox"
+ py:attrs="cur_fencedev and cur_fencedev.getAttribute('lanplus') and {'checked':'checked'} or {}"/>
</td>
</tr>
<tr>
- <td>Power Timeout (seconds)</td>
+ <td>Ciphersuite to use</td>
<td>
- <input type="text" class="text" name="power_timeout"
- py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('power_timeout')} or {}"/>
+ <input name="cipher" type="text" class="text"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('cipher')} or {}"/>
</td>
</tr>
<tr>
- <td>Shell Timeout (seconds)</td>
+ <td>Privilege Level</td>
<td>
- <input type="text" class="text" name="shell_timeout"
- py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('shell_timeout')} or {}"/>
+ <py:with vars="privlvl = cur_fencedev and cur_fencedev.getAttribute('privlvl')">
+ <select name="privlvl">
+ <option value=""
+ py:attrs="not privlvl and {'selected':'selected'} or {}">Default</option>
+ <option value="CALLBACK"
+ py:attrs="privlvl and privlvl.upper() == 'CALLBACK' and {'selected':'selected'} or {}">CALLBACK</option>
+ <option value="USER"
+ py:attrs="privlvl and privlvl.upper() == 'USER' and {'selected':'selected'} or {}">USER</option>
+ <option value="OPERATOR"
+ py:attrs="privlvl and privlvl.upper() == 'OPERATOR' and {'selected':'selected'} or {}">OPERATOR</option>
+ <option value="ADMINISTRATOR"
+ py:attrs="privlvl and privlvl.upper() == 'ADMINISTRATOR' and {'selected':'selected'} or {}">ADMINISTRATOR</option>
+ </select>
+ </py:with>
</td>
</tr>
<tr>
- <td>Login Timeout (seconds)</td>
+ <td>IPMI Operation Timeout</td>
<td>
- <input type="text" class="text" name="login_timeout"
- py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('login_timeout')} or {}"/>
+ <input name="timeout" type="text" class="text"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('timeout')}"/>
</td>
</tr>
<tr>
- <td>Times to Retry Power On Operation</td>
+ <td>Power Wait (seconds)</td>
<td>
- <input type="text" class="text" name="retry_on"
- py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('retry_on')} or {}"/>
+ <input type="text" class="text" name="power_wait"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('power_wait')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Delay (seconds)</td>
+ <td>
+ <input name="delay" type="text" class="text"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('delay')}"/>
</td>
</tr>
</table>
diff --git a/luci/validation/validate_fence.py b/luci/validation/validate_fence.py
index c05e8be..f9874a6 100644
--- a/luci/validation/validate_fence.py
+++ b/luci/validation/validate_fence.py
@@ -853,8 +853,8 @@ FD_VALIDATE = {
'fence_ilo_mp': val_ilo_mp_fd,
'fence_ilo': val_ilo_fd,
'fence_ilo2': val_ilo_fd,
- 'fence_ilo3': val_ilo_fd,
- 'fence_ilo4': val_ilo_fd,
+ 'fence_ilo3': val_ipmilan_fd,
+ 'fence_ilo4': val_ipmilan_fd,
'fence_intelmodular': val_intelmodular_fd,
'fence_ipdu': val_ipdu_fd,
'fence_ipmilan': val_ipmilan_fd,
10 years, 7 months