[luci] luci: Fix display of OracleDB type
by Ryan McCabe
commit b4e7e5512ba75c0babd9cea7d718eb80a8796846
Author: Ryan McCabe <rmccabe(a)redhat.com>
Date: Fri Dec 21 10:29:57 2012 -0500
luci: Fix display of OracleDB type
Fix the display of the OracleDB type attribute. Currently, it
will always show "Default" even if something other than the
default is selected.
Patch from John Ruemker <jruemker(a)redhat.com>
Signed-off-by: Ryan McCabe <rmccabe(a)redhat.com>
luci/templates/resource_list.html | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/luci/templates/resource_list.html b/luci/templates/resource_list.html
index 1d2f5c6..e3097ae 100644
--- a/luci/templates/resource_list.html
+++ b/luci/templates/resource_list.html
@@ -1422,13 +1422,13 @@
<select name="oracletype" class="serviceformselect"
py:attrs="{'disabled':global_resource and 'disabled' or None}">
<option value=""
- py:attrs="(not res or not res.getAttribute('oracletype')) and {'selected':'selected'} or {}">Default</option>
+ py:attrs="(not res or not res.getAttribute('type')) and {'selected':'selected'} or {}">Default</option>
<option value="base"
- py:attrs="res and res.getAttribute('oracletype') == 'base' and {'selected':'selected'} or {}">Database Instance and Listener Only</option>
+ py:attrs="res and res.getAttribute('type') == 'base' and {'selected':'selected'} or {}">Database Instance and Listener Only</option>
<option value="base-em"
- py:attrs="res and res.getAttribute('oracletype') == 'base-em' and {'selected':'selected'} or {}">Database, Listener, Enterprise Manager, and iSQL*Plus</option>
+ py:attrs="res and res.getAttribute('type') == 'base-em' and {'selected':'selected'} or {}">Database, Listener, Enterprise Manager, and iSQL*Plus</option>
<option value="ias"
- py:attrs="res and res.getAttribute('oracletype') == 'ias' and {'selected':'selected'} or {}">Internet Application Server (Infrastructure)</option>
+ py:attrs="res and res.getAttribute('type') == 'ias' and {'selected':'selected'} or {}">Internet Application Server (Infrastructure)</option>
</select>
</td>
</tr>
11 years, 5 months
[luci] bz877098: luci support for fence_sanlock: enforce unfence elem 2
by Jan Pokorný
commit eb7473f8b43539643af58bd65c3ca3e1703bca4e
Author: Jan Pokorný <jpokorny(a)redhat.com>
Date: Tue Dec 11 20:29:18 2012 +0100
bz877098: luci support for fence_sanlock: enforce unfence elem 2
fence_scsi ditto
Signed-off-by: Jan Pokorný <jpokorny(a)redhat.com>
luci/templates/fence_instances.html | 21 +++++++++++++++++----
1 files changed, 17 insertions(+), 4 deletions(-)
---
diff --git a/luci/templates/fence_instances.html b/luci/templates/fence_instances.html
index 8544988..b10c4ec 100644
--- a/luci/templates/fence_instances.html
+++ b/luci/templates/fence_instances.html
@@ -2,6 +2,15 @@
xmlns:xi="http://www.w3.org/2001/XInclude"
py:strip="">
+<py:def function="unfence_alert(unfencing)">
+ <div class="message" py:if="not unfencing">
+ <div class="alert">
+ Unfencing seems not to be set, however it is expected to be.
+ Submitting this form will enforce this proper configuration.
+ </div>
+ </div>
+</py:def>
+
<div py:def="fence_apc_instance(cur_fence_inst, cur_fence_dev_id, fi_id, **kw)" id="fence_apc_instance"
py:attrs="fi_id is not None and {'id': fi_id, 'class':'fenceinst'}">
<table class="detailstable">
@@ -495,6 +504,7 @@
<div py:def="fence_sanlock_instance(cur_fence_inst, cur_fence_dev_id, fi_id, **kw)" id="fence_sanlock_instance"
py:attrs="fi_id is not None and {'id': fi_id, 'class':'fenceinst'}">
+ ${unfence_alert(kw.get('unfencing', True))}
<table class="detailstable">
<tr>
<td>Host id</td>
@@ -506,9 +516,10 @@
<tr>
<td>Unfencing</td>
<td>
- <input type="checkbox" class="checkbox" name="unfencing" disabled="disabled"
- checked="checked"/>
+ <input type="checkbox" class="checkbox" name="unfencing_dummy"
+ disabled="disabled" checked="checked"/>
<label class="choice">Enable</label>
+ <input type="hidden" name="unfencing" value="checked" />
<input type="hidden" name="unfence_action" value="on" />
</td>
</tr>
@@ -1171,13 +1182,15 @@
<div py:def="fence_scsi_instance(cur_fence_inst, cur_fence_dev_id, fi_id, **kw)" id="fence_scsi_instance"
py:attrs="fi_id is not None and {'id': fi_id, 'class':'fenceinst'}">
+ ${unfence_alert(kw.get('unfencing', True))}
<table class="detailstable">
<tr>
<td>Unfencing</td>
<td>
- <input type="checkbox" class="checkbox" name="unfencing" disabled="disabled"
- checked="checked"/>
+ <input type="checkbox" class="checkbox" name="unfencing_dummy"
+ disabled="disabled" checked="checked"/>
<label class="choice">Enable</label>
+ <input type="hidden" name="unfencing" value="checked" />
<input type="hidden" name="unfence_action" value="on" />
</td>
</tr>
11 years, 5 months
[luci] bz877098: luci support for fence_sanlock: force unfence elems
by Jan Pokorný
commit 1fd0c84042514b429188117f9522c48c5bebd0f3
Author: Jan Pokorný <jpokorny(a)redhat.com>
Date: Tue Dec 11 20:23:41 2012 +0100
bz877098: luci support for fence_sanlock: force unfence elems
fence_scsi ditto
Signed-off-by: Jan Pokorný <jpokorny(a)redhat.com>
luci/templates/fence_instances.html | 8 ++++----
luci/validation/validate_fence.py | 2 ++
2 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/luci/templates/fence_instances.html b/luci/templates/fence_instances.html
index cb6d0f7..8544988 100644
--- a/luci/templates/fence_instances.html
+++ b/luci/templates/fence_instances.html
@@ -506,8 +506,8 @@
<tr>
<td>Unfencing</td>
<td>
- <input type="checkbox" class="checkbox" name="unfencing"
- py:attrs="(not cur_fence_inst or kw.get('unfencing', True)) and {'checked': 'checked'}"/>
+ <input type="checkbox" class="checkbox" name="unfencing" disabled="disabled"
+ checked="checked"/>
<label class="choice">Enable</label>
<input type="hidden" name="unfence_action" value="on" />
</td>
@@ -1175,8 +1175,8 @@
<tr>
<td>Unfencing</td>
<td>
- <input type="checkbox" class="checkbox" name="unfencing"
- py:attrs="(not cur_fence_inst or kw.get('unfencing', True)) and {'checked': 'checked'}"/>
+ <input type="checkbox" class="checkbox" name="unfencing" disabled="disabled"
+ checked="checked"/>
<label class="choice">Enable</label>
<input type="hidden" name="unfence_action" value="on" />
</td>
diff --git a/luci/validation/validate_fence.py b/luci/validation/validate_fence.py
index 6f5f7bc..019dfac 100644
--- a/luci/validation/validate_fence.py
+++ b/luci/validation/validate_fence.py
@@ -1201,6 +1201,7 @@ def val_scsi_fi(fenceinst, parent_name, **kw):
params = (
('nodename', False),
('key', False),
+ ('unfencing', True), # just a template sanity-check
)
errors = config_fence_attr(params, fenceinst, parent_name, **kw)
@@ -1227,6 +1228,7 @@ def val_eaton_snmp_fi(fenceinst, parent_name, **kw):
def val_sanlock_fi(fenceinst, parent_name, **kw):
params = (
('host_id', True),
+ ('unfencing', True), # just a template sanity-check
)
errors = config_fence_attr(params, fenceinst, parent_name, **kw)
11 years, 5 months
[luci] bz877098: luci support for fence_sanlock (remove resp. unfence properly)
by Jan Pokorný
commit 4167a77f0ac37354e44fa465244e99389986c4d7
Author: Jan Pokorný <jpokorny(a)redhat.com>
Date: Tue Dec 11 16:56:41 2012 +0100
bz877098: luci support for fence_sanlock (remove resp. unfence properly)
Signed-off-by: Jan Pokorný <jpokorny(a)redhat.com>
luci/lib/ClusterConf/Device.py | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/luci/lib/ClusterConf/Device.py b/luci/lib/ClusterConf/Device.py
index 12758c5..9ab9219 100644
--- a/luci/lib/ClusterConf/Device.py
+++ b/luci/lib/ClusterConf/Device.py
@@ -44,11 +44,14 @@ class Device(TagObject):
if self.getAttribute('port') == unfence.getAttribute('port'):
return True
elif agent_type == 'fence_egenera':
- if (self.getAttribute('pserver') == unfence.getAttribute('pserver')
- and self.getAttribute('lpan') == unfence.getAttribute('lpan')):
- return True
+ if (self.getAttribute('pserver') == unfence.getAttribute('pserver')
+ and self.getAttribute('lpan') == unfence.getAttribute('lpan')):
+ return True
+ elif agent_type == 'fence_sanlock':
+ if self.getAttribute('host_id') == unfence.getAttribute('host_id'):
+ return True
return False
-
+
def hasNativeOptionSet(self):
return self.has_native_option_set
11 years, 5 months
[luci] Revert "bz877098: luci support for fence_sanlock (remove resp. unfence)"
by Jan Pokorný
commit e9f7d203ee503072a62b00254fd5c7942ec8b5f6
Author: Jan Pokorný <jpokorny(a)redhat.com>
Date: Tue Dec 11 16:50:20 2012 +0100
Revert "bz877098: luci support for fence_sanlock (remove resp. unfence)"
I suspected there is something to do in matchesUnfence, but this was
plain wrong.
This reverts commit cc041bb70d3a1b4a928d07efebfed470bbe59981.
luci/lib/ClusterConf/Device.py | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/luci/lib/ClusterConf/Device.py b/luci/lib/ClusterConf/Device.py
index f988b72..12758c5 100644
--- a/luci/lib/ClusterConf/Device.py
+++ b/luci/lib/ClusterConf/Device.py
@@ -47,8 +47,8 @@ class Device(TagObject):
if (self.getAttribute('pserver') == unfence.getAttribute('pserver')
and self.getAttribute('lpan') == unfence.getAttribute('lpan')):
return True
- return True
-
+ return False
+
def hasNativeOptionSet(self):
return self.has_native_option_set
11 years, 5 months
[luci] bz877098: luci support for fence_sanlock (remove resp. unfence properly)
by Jan Pokorný
commit cc041bb70d3a1b4a928d07efebfed470bbe59981
Author: Jan Pokorný <jpokorny(a)redhat.com>
Date: Mon Dec 10 19:01:15 2012 +0100
bz877098: luci support for fence_sanlock (remove resp. unfence properly)
This change requires a proper testing and reverting when it shows up to
be screwed.
Signed-off-by: Jan Pokorný <jpokorny(a)redhat.com>
luci/lib/ClusterConf/Device.py | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/luci/lib/ClusterConf/Device.py b/luci/lib/ClusterConf/Device.py
index 12758c5..f988b72 100644
--- a/luci/lib/ClusterConf/Device.py
+++ b/luci/lib/ClusterConf/Device.py
@@ -47,8 +47,8 @@ class Device(TagObject):
if (self.getAttribute('pserver') == unfence.getAttribute('pserver')
and self.getAttribute('lpan') == unfence.getAttribute('lpan')):
return True
- return False
-
+ return True
+
def hasNativeOptionSet(self):
return self.has_native_option_set
11 years, 5 months
[luci] bz877098: luci support for fence_sanlock
by Jan Pokorný
commit ec2c0795bf9eeddc558b8f29646ed3f917e84fa3
Author: Jan Pokorný <jpokorny(a)redhat.com>
Date: Mon Dec 10 18:57:53 2012 +0100
bz877098: luci support for fence_sanlock
Probably requires another adjustment (subsequent commit) in order
to remove spective unfence parts properly.
Signed-off-by: Jan Pokorný <jpokorny(a)redhat.com>
luci/lib/ClusterConf/FenceDeviceAttr.py | 2 +
luci/templates/fence_devices.html | 37 +++++++++++++++++++++++++++++++
luci/templates/fence_instances.html | 34 ++++++++++++++++++++++++++++
luci/validation/validate_fence.py | 18 +++++++++++++++
4 files changed, 91 insertions(+), 0 deletions(-)
---
diff --git a/luci/lib/ClusterConf/FenceDeviceAttr.py b/luci/lib/ClusterConf/FenceDeviceAttr.py
index 33a2564..bf11d20 100644
--- a/luci/lib/ClusterConf/FenceDeviceAttr.py
+++ b/luci/lib/ClusterConf/FenceDeviceAttr.py
@@ -54,6 +54,7 @@ FENCE_OPTS = {
'fence_eps': 'ePowerSwitch',
'fence_virsh': 'virsh fence agent',
'fence_rhevm': 'RHEV-M fence agent',
+ 'fence_sanlock': 'Sanlock fencing (watchdog and shared storage leases)',
}
FENCE_SHARED = {
@@ -87,6 +88,7 @@ FENCE_SHARED = {
'fence_intelmodular': True,
'fence_virsh': True,
'fence_rhevm': True,
+ 'fence_sanlock': True,
'fence_ilo': False,
'fence_ilo_mp': False,
'fence_ipmilan': False,
diff --git a/luci/templates/fence_devices.html b/luci/templates/fence_devices.html
index c2d86b3..561fe16 100644
--- a/luci/templates/fence_devices.html
+++ b/luci/templates/fence_devices.html
@@ -611,6 +611,41 @@
<input type="hidden" name="fence_type" value="fence_sanbox2" />
</div>
+<div py:def="fence_sanlock(cur_fencedev, ni)" id="fence_sanlock" class="fencedevform row"
+ py:attrs="cur_fencedev and {'id': 'fd_%s' % cur_fencedev.getName()}">
+ <table class="formtable">
+ <tr>
+ <td>Fence Type</td>
+ <td>Sanlock</td>
+ </tr>
+ <tr>
+ <td>Name</td>
+ <td>
+ <input name="name" type="text" class="text"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getName()} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>The path to shared storage with sanlock leases</td>
+ <td>
+ <input name="path" type="text" class="text"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('path')} or {}"/>
+ </td>
+ </tr>
+ </table>
+
+ <py:if test="cur_fencedev">
+ <input type="hidden"
+ name="orig_name" value="${cur_fencedev.getName()}"/>
+ <input type="hidden"
+ name="existing_device" value="1" />
+ </py:if>
+
+ <input type="hidden" name="sharable" value="1" />
+ <input type="hidden" name="num_instances" value="${ni}"/>
+ <input type="hidden" name="fence_type" value="fence_sanlock" />
+</div>
+
<div py:def="fence_vixel(cur_fencedev, ni)" id="fence_vixel" class="fencedevform row"
py:attrs="cur_fencedev and {'id': 'fd_%s' % cur_fencedev.getName()}">
<table class="formtable">
@@ -4234,6 +4269,7 @@ ${fence_zvm(None,0)}
${fence_ibmblade(None,0)}
${fence_hpblade(None,0)}
${fence_eaton_snmp(None,0)}
+${fence_sanlock(None,0)}
${fence_unknown(None,0)}
</div>
@@ -4283,6 +4319,7 @@ ${fence_unknown(None,0)}
<py:when test="3">
<option name="fence_virt" value="fence_virt">Fence virt (Tech Preview)</option>
<option name="fence_xvm" value="fence_xvm">Fence virt (Multicast Mode)</option>
+ <option name="fence_sanlock" value="fence_sanlock">Sanlock (Tech Preview)</option>
</py:when>
</py:choose>
<option py:if="cluster_version == 2" name="fence_xvm" value="fence_xvm">Fence xvm</option>
diff --git a/luci/templates/fence_instances.html b/luci/templates/fence_instances.html
index 8032cd2..cb6d0f7 100644
--- a/luci/templates/fence_instances.html
+++ b/luci/templates/fence_instances.html
@@ -493,6 +493,39 @@
py:attrs="cur_fence_dev_id and {'value': cur_fence_dev_id} or {}" />
</div>
+<div py:def="fence_sanlock_instance(cur_fence_inst, cur_fence_dev_id, fi_id, **kw)" id="fence_sanlock_instance"
+ py:attrs="fi_id is not None and {'id': fi_id, 'class':'fenceinst'}">
+ <table class="detailstable">
+ <tr>
+ <td>Host id</td>
+ <td>
+ <input name="host_id" type="text" class="text"
+ py:attrs="cur_fence_inst and {'value': cur_fence_inst.getAttribute('host_id')}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Unfencing</td>
+ <td>
+ <input type="checkbox" class="checkbox" name="unfencing"
+ py:attrs="(not cur_fence_inst or kw.get('unfencing', True)) and {'checked': 'checked'}"/>
+ <label class="choice">Enable</label>
+ <input type="hidden" name="unfence_action" value="on" />
+ </td>
+ </tr>
+ <tr><td colspan="2">
+ <div>
+ <input type="button" name="remove_fence" value="Remove this instance"
+ py:attrs="fi_id is not None and {'onclick': '$(\'#%s\').remove()' % fi_id} or {}"/>
+ </div>
+ </td></tr>
+ </table>
+
+ <input type="hidden" name="fence_type" value="fence_sanlock" />
+ <input type="hidden" name="fence_instance" value="1" />
+ <input type="hidden" name="parent_fencedev"
+ py:attrs="cur_fence_dev_id and {'value': cur_fence_dev_id} or {}" />
+</div>
+
<div py:def="fence_mcdata_instance(cur_fence_inst, cur_fence_dev_id, fi_id, **kw)" id="fence_mcdata_instance"
py:attrs="fi_id is not None and {'id': fi_id, 'class':'fenceinst'}">
<table class="detailstable">
@@ -1314,6 +1347,7 @@ ${fence_rsb_instance(None, None, None)}
${fence_xcat_instance(None, None, None)}
${fence_zvm_instance(None, None, None)}
${fence_scsi_instance(None, None, None, nodename=nodename)}
+${fence_sanlock_instance(None, None, None)}
${fence_unknown_instance(None, None, None)}
</div>
</html>
diff --git a/luci/validation/validate_fence.py b/luci/validation/validate_fence.py
index 64ddc00..6f5f7bc 100644
--- a/luci/validation/validate_fence.py
+++ b/luci/validation/validate_fence.py
@@ -362,6 +362,14 @@ def val_bullpap_fd(fencedev, fence_name, **kw):
errors = config_fence_attr(params, fencedev, fence_name, **kw)
return errors
+def val_sanlock_fd(fencedev, fence_name, **kw):
+ params = (
+ ('path', True),
+ )
+
+ errors = config_fence_attr(params, fencedev, fence_name, **kw)
+ return errors
+
def val_noop_fd(fencedev, fence_name, **kw):
return []
@@ -857,6 +865,7 @@ FD_VALIDATE = {
'fence_rsa': val_rsa_fd,
'fence_rsb': val_rsb_fd,
'fence_sanbox2': val_sanbox2_fd,
+ 'fence_sanlock': val_sanlock_fd,
'fence_scsi': val_scsi_fd,
'fence_virsh': val_virsh_fd,
'fence_virt': val_virt_fd,
@@ -1215,6 +1224,14 @@ def val_eaton_snmp_fi(fenceinst, parent_name, **kw):
errors = config_fence_attr(params, fenceinst, parent_name, **kw)
return errors
+def val_sanlock_fi(fenceinst, parent_name, **kw):
+ params = (
+ ('host_id', True),
+ )
+
+ errors = config_fence_attr(params, fenceinst, parent_name, **kw)
+ return errors
+
def val_noop_fi(fenceinst, parent_name, **kw):
return []
@@ -1252,6 +1269,7 @@ FI_VALIDATE = {
'fence_rsa': val_noop_fi,
'fence_rsb': val_noop_fi,
'fence_sanbox2': val_sanbox2_fi,
+ 'fence_sanlock': val_sanlock_fi,
'fence_scsi': val_scsi_fi,
'fence_virsh': val_virsh_fi,
'fence_virt': val_virt_fi,
11 years, 5 months
[luci] luci: Fix for tracebacks when no nodes can be contacted
by Ryan McCabe
commit 04b72fa55081041a79b339ad10ca0d8a582b0256
Author: Ryan McCabe <rmccabe(a)redhat.com>
Date: Fri Dec 7 13:31:14 2012 -0500
luci: Fix for tracebacks when no nodes can be contacted
Patch from Radek Steiger <rsteiger(a)redhat.com> to fix
tracebacks that occurred in the fence devices, failover
domains, and services sections when no nodes from a cluster
cannot be contacted.
Signed-off-by: Ryan McCabe <rmccabe(a)redhat.com>
luci/controllers/cluster.py | 21 +++++++++++++++------
1 files changed, 15 insertions(+), 6 deletions(-)
---
diff --git a/luci/controllers/cluster.py b/luci/controllers/cluster.py
index 593d6e1..0e3f043 100644
--- a/luci/controllers/cluster.py
+++ b/luci/controllers/cluster.py
@@ -640,8 +640,11 @@ class IndividualClusterController(BaseController):
if 'name' in request.params:
servicename = request.params['name']
- self.get_model()
- if not self.model.getService(servicename):
+ try:
+ self.get_model()
+ if not self.model.getService(servicename):
+ servicename = None
+ except Exception, e:
servicename = None
return dict(page='nodes', name=servicename, base_url=base_url, services_cmd=services_cmd)
@@ -812,8 +815,11 @@ class IndividualClusterController(BaseController):
if 'name' in request.params:
failovername = request.params['name']
- self.get_model()
- if not self.model.getFailoverDomainByName(failovername):
+ try:
+ self.get_model()
+ if not self.model.getFailoverDomainByName(failovername):
+ failovername = None
+ except Exception, e:
failovername = None
return dict(page='nodes', name=failovername, base_url = '/cluster/' + self.name + '/failovers', failovers_cmd=failovers_cmd)
@@ -932,8 +938,11 @@ class IndividualClusterController(BaseController):
if 'name' in request.params:
fencename = request.params['name']
- self.get_model()
- if not self.model.getFenceDeviceByName(fencename):
+ try:
+ self.get_model()
+ if not self.model.getFenceDeviceByName(fencename):
+ fencename = None
+ except Exception, e:
fencename = None
return dict(page='nodes', name=fencename, base_url='/cluster/' + self.name + '/fences', fences_cmd=fences_cmd)
11 years, 5 months
[luci] luci: Add support for fence device attributes
by Ryan McCabe
commit f581a7e89a64a04816b083089aba4d4ce5f00274
Author: Ryan McCabe <rmccabe(a)redhat.com>
Date: Wed Dec 5 09:14:22 2012 -0500
luci: Add support for fence device attributes
Add support for configuring the "delay" "power_timeout"
"shell_timeout" "login_timeout" and "retry_on" attributes
for fence devices that support them.
Resolves: rhbz#883008
Signed-off-by: Ryan McCabe <rmccabe(a)redhat.com>
luci/controllers/cluster.py | 29 +-
luci/templates/fence_devices.html | 796 ++++++++++++++++++++++++++++++++++-
luci/templates/fence_instances.html | 180 +++++++-
luci/validation/validate_fence.py | 138 ++++++-
4 files changed, 1109 insertions(+), 34 deletions(-)
---
diff --git a/luci/controllers/cluster.py b/luci/controllers/cluster.py
index 6e09e2f..593d6e1 100644
--- a/luci/controllers/cluster.py
+++ b/luci/controllers/cluster.py
@@ -515,7 +515,7 @@ class IndividualClusterController(BaseController):
self.get_model()
self.model.getResourceByName(resourcename)
except Exception, e:
- resourcename=None
+ resourcename = None
return dict(page='nodes', name=resourcename, base_url=base_url, resources_cmd=resources_cmd)
@@ -915,7 +915,7 @@ class IndividualClusterController(BaseController):
redirect(tmpl_context.cluster_url)
@expose("luci.templates.fence")
- def fences(self, *args):
+ def fences(self, *args, **kwargs):
fences_cmd = '/cluster/%s/fences_cmd' % self.name
try:
@@ -924,14 +924,14 @@ class IndividualClusterController(BaseController):
flash(e, status="warning")
redirect("/")
- if len(args) == 1:
- if request.response_ext:
- fencename = '%s%s' % (args[0], request.response_ext)
- else:
- fencename = args[0]
+ if len(args) >= 1:
+ fencename = '/'.join([unquote_plus(a) for a in args])
else:
fencename = None
+ if 'name' in request.params:
+ fencename = request.params['name']
+
self.get_model()
if not self.model.getFenceDeviceByName(fencename):
fencename = None
@@ -941,6 +941,7 @@ class IndividualClusterController(BaseController):
@expose("luci.templates.fence")
def fences_cmd(self, command=None, **kw):
tmpl_context.cluster_url = '/cluster/%s/fences' % self.name
+ redir_fmt = '%s?name=%s'
try:
permission_config(self.name)
@@ -973,12 +974,18 @@ class IndividualClusterController(BaseController):
fret = validateNewFenceDevice(self.model, **kw)
if fret[0] is True:
rh.update_cluster_conf(self.model)
- log.info('User "%s" created fence devices "%s" in cluster "%s"'
+ flash(_('Created fence device "%s"') % cur_list[0])
+ log.info('User "%s" created fence device "%s" in cluster "%s"'
% (self.username, ', '.join(cur_list), self.name))
+ redirect(redir_fmt
+ % (tmpl_context.cluster_url, quote_plus(cur_list[0])))
else:
msgs = fret[1]
if msgs and len(msgs) > 0:
flash(', '.join(msgs), status="error")
+ else:
+ flash(_('Creating fence device %s failed') % cur_list[0],
+ status="error")
elif command == 'Delete':
log.info('User "%s" deleted fence devices "%s" in cluster "%s"'
% (self.username, ', '.join(cur_list), self.name))
@@ -995,12 +1002,18 @@ class IndividualClusterController(BaseController):
fret = validateFenceDevice(self.model, **kw)
if fret[0] is True:
rh.update_cluster_conf(self.model)
+ flash(_('Edited fence device "%s"') % cur_list[0])
log.info('User "%s" updated fence device "%s" in cluster "%s"'
% (self.username, ', '.join(cur_list), self.name))
+ redirect(redir_fmt
+ % (tmpl_context.cluster_url, quote_plus(cur_list[0])))
else:
msgs = fret[1]
if msgs and len(msgs) > 0:
flash(', '.join(msgs), status="error")
+ else:
+ flash(_('Updating fence device %s failed') % cur_list[0],
+ status="error")
else:
log.error('User "%s" submitted unknown command "%s" for fence devices "%s" from cluster "%s"'
% (self.username, command, ', '.join(cur_list), self.name))
diff --git a/luci/templates/fence_devices.html b/luci/templates/fence_devices.html
index d0a2b4c..c2d86b3 100644
--- a/luci/templates/fence_devices.html
+++ b/luci/templates/fence_devices.html
@@ -60,6 +60,34 @@
py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('power_wait')} or {}"/>
</td>
</tr>
+ <tr>
+ <td>Power Timeout (seconds)</td>
+ <td>
+ <input type="text" class="text" name="power_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('power_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Shell Timeout (seconds)</td>
+ <td>
+ <input type="text" class="text" name="shell_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('shell_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Login Timeout (seconds)</td>
+ <td>
+ <input type="text" class="text" name="login_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('login_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Times to Retry Power On Operation</td>
+ <td>
+ <input type="text" class="text" name="retry_on"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('retry_on')} or {}"/>
+ </td>
+ </tr>
</table>
<py:if test="cur_fencedev">
@@ -211,6 +239,34 @@
py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('power_wait')} or {}"/>
</td>
</tr>
+ <tr>
+ <td>Power Timeout (seconds)</td>
+ <td>
+ <input type="text" class="text" name="power_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('power_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Shell Timeout (seconds)</td>
+ <td>
+ <input type="text" class="text" name="shell_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('shell_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Login Timeout (seconds)</td>
+ <td>
+ <input type="text" class="text" name="login_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('login_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Times to Retry Power On Operation</td>
+ <td>
+ <input type="text" class="text" name="retry_on"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('retry_on')} or {}"/>
+ </td>
+ </tr>
</table>
<py:if test="cur_fencedev">
@@ -348,6 +404,34 @@
py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('power_wait')} or {}"/>
</td>
</tr>
+ <tr>
+ <td>Power Timeout (seconds)</td>
+ <td>
+ <input type="text" class="text" name="power_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('power_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Shell Timeout (seconds)</td>
+ <td>
+ <input type="text" class="text" name="shell_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('shell_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Login Timeout (seconds)</td>
+ <td>
+ <input type="text" class="text" name="login_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('login_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Times to Retry Power On Operation</td>
+ <td>
+ <input type="text" class="text" name="retry_on"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('retry_on')} or {}"/>
+ </td>
+ </tr>
</table>
<py:if test="cur_fencedev">
@@ -485,6 +569,34 @@
py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('power_wait')} or {}"/>
</td>
</tr>
+ <tr>
+ <td>Power Timeout (seconds)</td>
+ <td>
+ <input type="text" class="text" name="power_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('power_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Shell Timeout (seconds)</td>
+ <td>
+ <input type="text" class="text" name="shell_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('shell_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Login Timeout (seconds)</td>
+ <td>
+ <input type="text" class="text" name="login_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('login_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Times to Retry Power On Operation</td>
+ <td>
+ <input type="text" class="text" name="retry_on"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('retry_on')} or {}"/>
+ </td>
+ </tr>
</table>
<py:if test="cur_fencedev">
@@ -771,6 +883,34 @@
py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('power_wait')} or {}"/>
</td>
</tr>
+ <tr>
+ <td>Power Timeout (seconds)</td>
+ <td>
+ <input type="text" class="text" name="power_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('power_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Shell Timeout (seconds)</td>
+ <td>
+ <input type="text" class="text" name="shell_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('shell_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Login Timeout (seconds)</td>
+ <td>
+ <input type="text" class="text" name="login_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('login_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Times to Retry Power On Operation</td>
+ <td>
+ <input type="text" class="text" name="retry_on"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('retry_on')} or {}"/>
+ </td>
+ </tr>
</table>
<py:if test="cur_fencedev">
@@ -843,6 +983,34 @@
py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('power_wait')} or {}"/>
</td>
</tr>
+ <tr>
+ <td>Power Timeout (seconds)</td>
+ <td>
+ <input type="text" class="text" name="power_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('power_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Shell Timeout (seconds)</td>
+ <td>
+ <input type="text" class="text" name="shell_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('shell_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Login Timeout (seconds)</td>
+ <td>
+ <input type="text" class="text" name="login_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('login_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Times to Retry Power On Operation</td>
+ <td>
+ <input type="text" class="text" name="retry_on"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('retry_on')} or {}"/>
+ </td>
+ </tr>
</table>
<py:if test="cur_fencedev">
@@ -1107,6 +1275,34 @@
py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('power_wait')} or {}"/>
</td>
</tr>
+ <tr>
+ <td>Power Timeout (seconds)</td>
+ <td>
+ <input type="text" class="text" name="power_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('power_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Shell Timeout (seconds)</td>
+ <td>
+ <input type="text" class="text" name="shell_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('shell_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Login Timeout (seconds)</td>
+ <td>
+ <input type="text" class="text" name="login_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('login_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Times to Retry Power On Operation</td>
+ <td>
+ <input type="text" class="text" name="retry_on"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('retry_on')} or {}"/>
+ </td>
+ </tr>
</table>
<py:if test="cur_fencedev">
@@ -1179,6 +1375,34 @@
py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('power_wait')} or {}"/>
</td>
</tr>
+ <tr>
+ <td>Power Timeout (seconds)</td>
+ <td>
+ <input type="text" class="text" name="power_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('power_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Shell Timeout (seconds)</td>
+ <td>
+ <input type="text" class="text" name="shell_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('shell_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Login Timeout (seconds)</td>
+ <td>
+ <input type="text" class="text" name="login_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('login_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Times to Retry Power On Operation</td>
+ <td>
+ <input type="text" class="text" name="retry_on"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('retry_on')} or {}"/>
+ </td>
+ </tr>
</table>
<py:if test="cur_fencedev">
@@ -1258,6 +1482,34 @@
py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('power_wait')} or {}"/>
</td>
</tr>
+ <tr>
+ <td>Power Timeout (seconds)</td>
+ <td>
+ <input type="text" class="text" name="power_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('power_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Shell Timeout (seconds)</td>
+ <td>
+ <input type="text" class="text" name="shell_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('shell_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Login Timeout (seconds)</td>
+ <td>
+ <input type="text" class="text" name="login_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('login_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Times to Retry Power On Operation</td>
+ <td>
+ <input type="text" class="text" name="retry_on"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('retry_on')} or {}"/>
+ </td>
+ </tr>
</table>
<py:if test="cur_fencedev">
@@ -1322,17 +1574,38 @@
</td>
</tr>
<tr>
- <td>Separator</td>
+ <td>Power Wait (seconds)</td>
+ <td>
+ <input type="text" class="text" name="power_wait"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('power_wait')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Power Timeout (seconds)</td>
<td>
- <input type="text" class="text" name="separator"
- py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('separator')} or {}"/>
+ <input type="text" class="text" name="power_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('power_timeout')} or {}"/>
</td>
</tr>
<tr>
- <td>Power Wait (seconds)</td>
+ <td>Shell Timeout (seconds)</td>
<td>
- <input type="text" class="text" name="power_wait"
- py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('power_wait')} or {}"/>
+ <input type="text" class="text" name="shell_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('shell_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Login Timeout (seconds)</td>
+ <td>
+ <input type="text" class="text" name="login_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('login_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Times to Retry Power On Operation</td>
+ <td>
+ <input type="text" class="text" name="retry_on"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('retry_on')} or {}"/>
</td>
</tr>
</table>
@@ -1423,6 +1696,34 @@
py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('power_wait')} or {}"/>
</td>
</tr>
+ <tr>
+ <td>Power Timeout (seconds)</td>
+ <td>
+ <input type="text" class="text" name="power_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('power_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Shell Timeout (seconds)</td>
+ <td>
+ <input type="text" class="text" name="shell_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('shell_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Login Timeout (seconds)</td>
+ <td>
+ <input type="text" class="text" name="login_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('login_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Times to Retry Power On Operation</td>
+ <td>
+ <input type="text" class="text" name="retry_on"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('retry_on')} or {}"/>
+ </td>
+ </tr>
</table>
<py:if test="cur_fencedev">
@@ -1495,6 +1796,41 @@
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>
+ <tr>
+ <td>Power Timeout (seconds)</td>
+ <td>
+ <input type="text" class="text" name="power_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('power_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Shell Timeout (seconds)</td>
+ <td>
+ <input type="text" class="text" name="shell_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('shell_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Login Timeout (seconds)</td>
+ <td>
+ <input type="text" class="text" name="login_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('login_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Times to Retry Power On Operation</td>
+ <td>
+ <input type="text" class="text" name="retry_on"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('retry_on')} or {}"/>
+ </td>
+ </tr>
</table>
<py:if test="cur_fencedev">
@@ -1584,6 +1920,13 @@
</select>
</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>
<py:if test="cur_fencedev">
@@ -1676,6 +2019,41 @@
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>
+ <tr>
+ <td>Power Timeout (seconds)</td>
+ <td>
+ <input type="text" class="text" name="power_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('power_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Shell Timeout (seconds)</td>
+ <td>
+ <input type="text" class="text" name="shell_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('shell_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Login Timeout (seconds)</td>
+ <td>
+ <input type="text" class="text" name="login_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('login_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Times to Retry Power On Operation</td>
+ <td>
+ <input type="text" class="text" name="retry_on"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('retry_on')} or {}"/>
+ </td>
+ </tr>
</table>
<py:if test="cur_fencedev">
@@ -1739,6 +2117,55 @@
py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('telnet_port')} or {}"/>
</td>
</tr>
+ <tr>
+ <td>Force Command Prompt</td>
+ <td>
+ <input type="text" class="text" name="cmd_prompt"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('cmd_prompt')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Power Wait (seconds)</td>
+ <td>
+ <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>
+ <tr>
+ <td>Power Timeout (seconds)</td>
+ <td>
+ <input type="text" class="text" name="power_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('power_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Shell Timeout (seconds)</td>
+ <td>
+ <input type="text" class="text" name="shell_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('shell_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Login Timeout (seconds)</td>
+ <td>
+ <input type="text" class="text" name="login_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('login_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Times to Retry Power On Operation</td>
+ <td>
+ <input type="text" class="text" name="retry_on"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('retry_on')} or {}"/>
+ </td>
+ </tr>
</table>
<py:if test="cur_fencedev">
@@ -1881,6 +2308,27 @@
</py:with>
</td>
</tr>
+ <tr>
+ <td>IPMI Operation Timeout</td>
+ <td>
+ <input name="timeout" type="text" class="text"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('timeout')}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Power Wait (seconds)</td>
+ <td>
+ <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>
<py:if test="cur_fencedev">
@@ -1951,6 +2399,41 @@
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>
+ <tr>
+ <td>Power Timeout (seconds)</td>
+ <td>
+ <input type="text" class="text" name="power_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('power_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Shell Timeout (seconds)</td>
+ <td>
+ <input type="text" class="text" name="shell_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('shell_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Login Timeout (seconds)</td>
+ <td>
+ <input type="text" class="text" name="login_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('login_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Times to Retry Power On Operation</td>
+ <td>
+ <input type="text" class="text" name="retry_on"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('retry_on')} or {}"/>
+ </td>
+ </tr>
</table>
<py:if test="cur_fencedev">
@@ -2100,6 +2583,34 @@
py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('power_wait')} or {}"/>
</td>
</tr>
+ <tr>
+ <td>Power Timeout (seconds)</td>
+ <td>
+ <input type="text" class="text" name="power_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('power_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Shell Timeout (seconds)</td>
+ <td>
+ <input type="text" class="text" name="shell_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('shell_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Login Timeout (seconds)</td>
+ <td>
+ <input type="text" class="text" name="login_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('login_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Times to Retry Power On Operation</td>
+ <td>
+ <input type="text" class="text" name="retry_on"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('retry_on')} or {}"/>
+ </td>
+ </tr>
</table>
<py:if test="cur_fencedev">
@@ -2186,6 +2697,34 @@
py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('power_wait')} or {}"/>
</td>
</tr>
+ <tr>
+ <td>Power Timeout (seconds)</td>
+ <td>
+ <input type="text" class="text" name="power_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('power_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Shell Timeout (seconds)</td>
+ <td>
+ <input type="text" class="text" name="shell_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('shell_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Login Timeout (seconds)</td>
+ <td>
+ <input type="text" class="text" name="login_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('login_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Times to Retry Power On Operation</td>
+ <td>
+ <input type="text" class="text" name="retry_on"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('retry_on')} or {}"/>
+ </td>
+ </tr>
</table>
<py:if test="cur_fencedev">
@@ -2318,6 +2857,41 @@
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>
+ <tr>
+ <td>Power Timeout (seconds)</td>
+ <td>
+ <input type="text" class="text" name="power_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('power_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Shell Timeout (seconds)</td>
+ <td>
+ <input type="text" class="text" name="shell_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('shell_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Login Timeout (seconds)</td>
+ <td>
+ <input type="text" class="text" name="login_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('login_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Times to Retry Power On Operation</td>
+ <td>
+ <input type="text" class="text" name="retry_on"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('retry_on')} or {}"/>
+ </td>
+ </tr>
</table>
<py:if test="cur_fencedev">
@@ -2381,6 +2955,13 @@
py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('hidden_page')} or {}"/>
</td>
</tr>
+ <tr>
+ <td>Times to Retry Power On Operation</td>
+ <td>
+ <input type="text" class="text" name="retry_on"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('retry_on')} or {}"/>
+ </td>
+ </tr>
</table>
<py:if test="cur_fencedev">
@@ -2532,6 +3113,34 @@
py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('power_wait')} or {}"/>
</td>
</tr>
+ <tr>
+ <td>Power Timeout (seconds)</td>
+ <td>
+ <input type="text" class="text" name="power_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('power_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Shell Timeout (seconds)</td>
+ <td>
+ <input type="text" class="text" name="shell_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('shell_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Login Timeout (seconds)</td>
+ <td>
+ <input type="text" class="text" name="login_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('login_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Times to Retry Power On Operation</td>
+ <td>
+ <input type="text" class="text" name="retry_on"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('retry_on')} or {}"/>
+ </td>
+ </tr>
</table>
<py:if test="cur_fencedev">
@@ -2626,6 +3235,41 @@
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>
+ <tr>
+ <td>Power Timeout (seconds)</td>
+ <td>
+ <input type="text" class="text" name="power_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('power_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Shell Timeout (seconds)</td>
+ <td>
+ <input type="text" class="text" name="shell_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('shell_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Login Timeout (seconds)</td>
+ <td>
+ <input type="text" class="text" name="login_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('login_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Times to Retry Power On Operation</td>
+ <td>
+ <input type="text" class="text" name="retry_on"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('retry_on')} or {}"/>
+ </td>
+ </tr>
</table>
<py:if test="cur_fencedev">
@@ -2775,6 +3419,34 @@
py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('power_wait')} or {}"/>
</td>
</tr>
+ <tr>
+ <td>Power Timeout (seconds)</td>
+ <td>
+ <input type="text" class="text" name="power_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('power_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Shell Timeout (seconds)</td>
+ <td>
+ <input type="text" class="text" name="shell_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('shell_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Login Timeout (seconds)</td>
+ <td>
+ <input type="text" class="text" name="login_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('login_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Times to Retry Power On Operation</td>
+ <td>
+ <input type="text" class="text" name="retry_on"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('retry_on')} or {}"/>
+ </td>
+ </tr>
</table>
<py:if test="cur_fencedev">
@@ -2851,6 +3523,34 @@
py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('power_wait')} or {}"/>
</td>
</tr>
+ <tr>
+ <td>Power Timeout (seconds)</td>
+ <td>
+ <input type="text" class="text" name="power_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('power_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Shell Timeout (seconds)</td>
+ <td>
+ <input type="text" class="text" name="shell_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('shell_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Login Timeout (seconds)</td>
+ <td>
+ <input type="text" class="text" name="login_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('login_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Times to Retry Power On Operation</td>
+ <td>
+ <input type="text" class="text" name="retry_on"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('retry_on')} or {}"/>
+ </td>
+ </tr>
</table>
<py:if test="cur_fencedev">
@@ -3156,6 +3856,34 @@
py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('power_wait')} or {}"/>
</td>
</tr>
+ <tr>
+ <td>Power Timeout (seconds)</td>
+ <td>
+ <input type="text" class="text" name="power_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('power_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Shell Timeout (seconds)</td>
+ <td>
+ <input type="text" class="text" name="shell_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('shell_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Login Timeout (seconds)</td>
+ <td>
+ <input type="text" class="text" name="login_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('login_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Times to Retry Power On Operation</td>
+ <td>
+ <input type="text" class="text" name="retry_on"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('retry_on')} or {}"/>
+ </td>
+ </tr>
</table>
<py:if test="cur_fencedev">
@@ -3307,6 +4035,34 @@
py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('power_wait')} or {}"/>
</td>
</tr>
+ <tr>
+ <td>Power Timeout (seconds)</td>
+ <td>
+ <input type="text" class="text" name="power_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('power_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Shell Timeout (seconds)</td>
+ <td>
+ <input type="text" class="text" name="shell_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('shell_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Login Timeout (seconds)</td>
+ <td>
+ <input type="text" class="text" name="login_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('login_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Times to Retry Power On Operation</td>
+ <td>
+ <input type="text" class="text" name="retry_on"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('retry_on')} or {}"/>
+ </td>
+ </tr>
</table>
<py:if test="cur_fencedev">
@@ -3393,6 +4149,34 @@
py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('power_wait')} or {}"/>
</td>
</tr>
+ <tr>
+ <td>Power Timeout (seconds)</td>
+ <td>
+ <input type="text" class="text" name="power_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('power_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Shell Timeout (seconds)</td>
+ <td>
+ <input type="text" class="text" name="shell_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('shell_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Login Timeout (seconds)</td>
+ <td>
+ <input type="text" class="text" name="login_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('login_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Times to Retry Power On Operation</td>
+ <td>
+ <input type="text" class="text" name="retry_on"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('retry_on')} or {}"/>
+ </td>
+ </tr>
</table>
<py:if test="cur_fencedev">
diff --git a/luci/templates/fence_instances.html b/luci/templates/fence_instances.html
index 66721c6..8032cd2 100644
--- a/luci/templates/fence_instances.html
+++ b/luci/templates/fence_instances.html
@@ -19,6 +19,13 @@
py:attrs="cur_fence_inst and {'value': cur_fence_inst.getAttribute('switch')}"/>
</td>
</tr>
+ <tr>
+ <td>Delay (optional)</td>
+ <td>
+ <input name="delay" type="text" class="text"
+ py:attrs="cur_fence_inst and {'value': cur_fence_inst.getAttribute('delay')}"/>
+ </td>
+ </tr>
<tr><td>
<fieldset>
<legend>SSH</legend>
@@ -74,6 +81,13 @@
</td>
</tr>
<tr>
+ <td>Delay (optional)</td>
+ <td>
+ <input name="delay" type="text" class="text"
+ py:attrs="cur_fence_inst and {'value': cur_fence_inst.getAttribute('delay')}"/>
+ </td>
+ </tr>
+ <tr>
<td>Unfencing</td>
<td>
<input type="checkbox" class="checkbox" name="unfencing"
@@ -114,6 +128,13 @@
</td>
</tr>
<tr>
+ <td>Delay (optional)</td>
+ <td>
+ <input name="delay" type="text" class="text"
+ py:attrs="cur_fence_inst and {'value': cur_fence_inst.getAttribute('delay')}"/>
+ </td>
+ </tr>
+ <tr>
<td>Path to SSH Identity File</td>
<td>
<input type="text" class="text" name="identity_file"
@@ -145,6 +166,13 @@
py:attrs="cur_fence_inst and {'value': cur_fence_inst.getAttribute('port')}"/>
</td>
</tr>
+ <tr>
+ <td>Delay (optional)</td>
+ <td>
+ <input name="delay" type="text" class="text"
+ py:attrs="cur_fence_inst and {'value': cur_fence_inst.getAttribute('delay')}"/>
+ </td>
+ </tr>
<tr><td>
<fieldset>
<legend>SSH</legend>
@@ -200,6 +228,13 @@
</td>
</tr>
<tr>
+ <td>Delay (optional)</td>
+ <td>
+ <input name="delay" type="text" class="text"
+ py:attrs="cur_fence_inst and {'value': cur_fence_inst.getAttribute('delay')}"/>
+ </td>
+ </tr>
+ <tr>
<td>
<span title="Enable SSL operation">Use SSL</span>
</td>
@@ -232,6 +267,13 @@
py:attrs="cur_fence_inst and {'value': cur_fence_inst.getAttribute('port')}"/>
</td>
</tr>
+ <tr>
+ <td>Delay (optional)</td>
+ <td>
+ <input name="delay" type="text" class="text"
+ py:attrs="cur_fence_inst and {'value': cur_fence_inst.getAttribute('delay')}"/>
+ </td>
+ </tr>
<tr><td>
<fieldset>
<legend>SSH</legend>
@@ -279,6 +321,13 @@
py:attrs="cur_fence_inst and {'value': cur_fence_inst.getAttribute('port')}"/>
</td>
</tr>
+ <tr>
+ <td>Delay (optional)</td>
+ <td>
+ <input name="delay" type="text" class="text"
+ py:attrs="cur_fence_inst and {'value': cur_fence_inst.getAttribute('delay')}"/>
+ </td>
+ </tr>
<tr><td>
<fieldset>
<legend>SSH</legend>
@@ -326,6 +375,13 @@
py:attrs="cur_fence_inst and {'value': cur_fence_inst.getAttribute('port')}"/>
</td>
</tr>
+ <tr>
+ <td>Delay (optional)</td>
+ <td>
+ <input name="delay" type="text" class="text"
+ py:attrs="cur_fence_inst and {'value': cur_fence_inst.getAttribute('delay')}"/>
+ </td>
+ </tr>
<tr><td colspan="2">
<div>
<input type="button" name="remove_fence" value="Remove this instance"
@@ -408,6 +464,13 @@
</td>
</tr>
<tr>
+ <td>Delay (optional)</td>
+ <td>
+ <input name="delay" type="text" class="text"
+ py:attrs="cur_fence_inst and {'value': cur_fence_inst.getAttribute('delay')}"/>
+ </td>
+ </tr>
+ <tr>
<td>Unfencing</td>
<td>
<input type="checkbox" class="checkbox" name="unfencing"
@@ -521,6 +584,13 @@
py:attrs="cur_fence_inst and {'value': cur_fence_inst.getAttribute('domain')}"/>
</td>
</tr>
+ <tr>
+ <td>Delay (optional)</td>
+ <td>
+ <input name="delay" type="text" class="text"
+ py:attrs="cur_fence_inst and {'value': cur_fence_inst.getAttribute('delay')}"/>
+ </td>
+ </tr>
<tr><td colspan="2">
<div>
<input type="button" name="remove_fence" value="Remove this instance"
@@ -545,6 +615,13 @@
py:attrs="cur_fence_inst and {'value': cur_fence_inst.getAttribute('domain')}"/>
</td>
</tr>
+ <tr>
+ <td>Delay (optional)</td>
+ <td>
+ <input name="delay" type="text" class="text"
+ py:attrs="cur_fence_inst and {'value': cur_fence_inst.getAttribute('delay')}"/>
+ </td>
+ </tr>
<tr><td colspan="2">
<div>
<input type="button" name="remove_fence" value="Remove this instance"
@@ -569,6 +646,13 @@
py:attrs="cur_fence_inst and {'value': cur_fence_inst.getAttribute('port')}"/>
</td>
</tr>
+ <tr>
+ <td>Delay (optional)</td>
+ <td>
+ <input name="delay" type="text" class="text"
+ py:attrs="cur_fence_inst and {'value': cur_fence_inst.getAttribute('delay')}"/>
+ </td>
+ </tr>
<tr><td>
<fieldset>
<legend>SSH</legend>
@@ -640,6 +724,13 @@
py:attrs="cur_fence_inst and {'value': cur_fence_inst.getAttribute('port')}"/>
</td>
</tr>
+ <tr>
+ <td>Delay (optional)</td>
+ <td>
+ <input name="delay" type="text" class="text"
+ py:attrs="cur_fence_inst and {'value': cur_fence_inst.getAttribute('delay')}"/>
+ </td>
+ </tr>
<tr><td>
<fieldset>
<legend>SSH</legend>
@@ -687,6 +778,13 @@
py:attrs="cur_fence_inst and {'value': cur_fence_inst.getAttribute('port')}"/>
</td>
</tr>
+ <tr>
+ <td>Delay (optional)</td>
+ <td>
+ <input name="delay" type="text" class="text"
+ py:attrs="cur_fence_inst and {'value': cur_fence_inst.getAttribute('delay')}"/>
+ </td>
+ </tr>
<tr><td colspan="2">
<div>
<input type="button" name="remove_fence" value="Remove this instance"
@@ -711,6 +809,13 @@
py:attrs="cur_fence_inst and {'value': cur_fence_inst.getAttribute('port')}"/>
</td>
</tr>
+ <tr>
+ <td>Delay (optional)</td>
+ <td>
+ <input name="delay" type="text" class="text"
+ py:attrs="cur_fence_inst and {'value': cur_fence_inst.getAttribute('delay')}"/>
+ </td>
+ </tr>
<tr><td colspan="2">
<div>
<input type="button" name="remove_fence" value="Remove this instance"
@@ -735,6 +840,13 @@
py:attrs="cur_fence_inst and {'value': cur_fence_inst.getAttribute('port')}"/>
</td>
</tr>
+ <tr>
+ <td>Delay (optional)</td>
+ <td>
+ <input name="delay" type="text" class="text"
+ py:attrs="cur_fence_inst and {'value': cur_fence_inst.getAttribute('delay')}"/>
+ </td>
+ </tr>
<tr><td colspan="2">
<div>
<input type="button" name="remove_fence" value="Remove this instance"
@@ -759,6 +871,13 @@
py:attrs="cur_fence_inst and {'value': cur_fence_inst.getAttribute('port')}"/>
</td>
</tr>
+ <tr>
+ <td>Delay (optional)</td>
+ <td>
+ <input name="delay" type="text" class="text"
+ py:attrs="cur_fence_inst and {'value': cur_fence_inst.getAttribute('delay')}"/>
+ </td>
+ </tr>
<tr><td colspan="2">
<div>
<input type="button" name="remove_fence" value="Remove this instance"
@@ -783,6 +902,13 @@
py:attrs="cur_fence_inst and {'value': cur_fence_inst.getAttribute('port')}"/>
</td>
</tr>
+ <tr>
+ <td>Delay (optional)</td>
+ <td>
+ <input name="delay" type="text" class="text"
+ py:attrs="cur_fence_inst and {'value': cur_fence_inst.getAttribute('delay')}"/>
+ </td>
+ </tr>
<tr><td colspan="2">
<div>
<input type="button" name="remove_fence" value="Remove this instance"
@@ -807,6 +933,13 @@
py:attrs="cur_fence_inst and {'value': cur_fence_inst.getAttribute('port')}"/>
</td>
</tr>
+ <tr>
+ <td>Delay (optional)</td>
+ <td>
+ <input name="delay" type="text" class="text"
+ py:attrs="cur_fence_inst and {'value': cur_fence_inst.getAttribute('delay')}"/>
+ </td>
+ </tr>
<tr><td colspan="2">
<div>
<input type="button" name="remove_fence" value="Remove this instance"
@@ -831,6 +964,13 @@
py:attrs="cur_fence_inst and {'value': cur_fence_inst.getAttribute('port')}"/>
</td>
</tr>
+ <tr>
+ <td>Delay (optional)</td>
+ <td>
+ <input name="delay" type="text" class="text"
+ py:attrs="cur_fence_inst and {'value': cur_fence_inst.getAttribute('delay')}"/>
+ </td>
+ </tr>
<tr><td colspan="2">
<div>
<input type="button" name="remove_fence" value="Remove this instance"
@@ -915,6 +1055,13 @@
py:attrs="cur_fence_inst and {'value': cur_fence_inst.getAttribute('port')}"/>
</td>
</tr>
+ <tr>
+ <td>Delay (optional)</td>
+ <td>
+ <input name="delay" type="text" class="text"
+ py:attrs="cur_fence_inst and {'value': cur_fence_inst.getAttribute('delay')}"/>
+ </td>
+ </tr>
<tr><td colspan="2">
<div>
<input type="button" name="remove_fence" value="Remove this instance"
@@ -929,16 +1076,6 @@
py:attrs="cur_fence_dev_id and {'value': cur_fence_dev_id} or {}" />
</div>
-<div py:def="fence_drac_instance(cur_fence_inst, cur_fence_dev_id, fi_id, **kw)" id="fence_drac_instance"
- py:attrs="fi_id is not None and {'id': fi_id, 'class':'fenceinst'}">
-
- <div class="emptyfenceinst">No additional parameters</div>
- <input type="hidden" name="fence_type" value="fence_drac" />
- <input type="hidden" name="fence_instance" value="1" />
- <input type="hidden" name="parent_fencedev"
- py:attrs="cur_fence_dev_id and {'value': cur_fence_dev_id} or {}" />
-</div>
-
<div py:def="fence_alom_instance(cur_fence_inst, cur_fence_dev_id, fi_id, **kw)" id="fence_alom_instance"
py:attrs="fi_id is not None and {'id': fi_id, 'class':'fenceinst'}">
@@ -1049,6 +1186,13 @@
py:attrs="cur_fence_inst and {'value': cur_fence_inst.getAttribute('port')}"/>
</td>
</tr>
+ <tr>
+ <td>Delay (optional)</td>
+ <td>
+ <input name="delay" type="text" class="text"
+ py:attrs="cur_fence_inst and {'value': cur_fence_inst.getAttribute('delay')}"/>
+ </td>
+ </tr>
<tr><td colspan="2">
<div>
<input type="button" name="remove_fence" value="Remove this instance"
@@ -1073,6 +1217,13 @@
py:attrs="cur_fence_inst and {'value': cur_fence_inst.getAttribute('port')}"/>
</td>
</tr>
+ <tr>
+ <td>Delay (optional)</td>
+ <td>
+ <input name="delay" type="text" class="text"
+ py:attrs="cur_fence_inst and {'value': cur_fence_inst.getAttribute('delay')}"/>
+ </td>
+ </tr>
<tr><td>
<fieldset>
<legend>SSH</legend>
@@ -1119,15 +1270,6 @@
py:attrs="cur_fence_dev_id and {'value': cur_fence_dev_id} or {}" />
</div>
-<div py:def="fence_drac_instance(cur_fence_inst, cur_fence_dev_id, fi_id, **kw)" id="fence_drac_instance"
- py:attrs="fi_id is not None and {'id': fi_id, 'class':'fenceinst'}">
-
- <div class="emptyfenceinst">No additional parameters</div>
- <input type="hidden" name="fence_type" value="fence_drac" />
- <input type="hidden" name="fence_instance" value="1" />
- <input type="hidden" name="parent_fencedev"
- py:attrs="cur_fence_dev_id and {'value': cur_fence_dev_id} or {}" />
-</div>
<div py:def="fence_instance_container(nodename)"
id="fence_instance_container" class="hidden">
${fence_apc_instance(None, None, None)}
diff --git a/luci/validation/validate_fence.py b/luci/validation/validate_fence.py
index af6c965..64ddc00 100644
--- a/luci/validation/validate_fence.py
+++ b/luci/validation/validate_fence.py
@@ -148,6 +148,10 @@ def val_apc_fd(fencedev, fence_name, **kw):
('passwd', False),
('passwd_script', False),
('power_wait', False),
+ ('power_timeout', False),
+ ('shell_timeout', False),
+ ('login_timeout', False),
+ ('retry_on', False),
)
errors = config_fence_attr(params, fencedev, fence_name, **kw)
return errors
@@ -161,6 +165,10 @@ def val_wti_fd(fencedev, fence_name, **kw):
('passwd', False),
('passwd_script', False),
('power_wait', False),
+ ('power_timeout', False),
+ ('shell_timeout', False),
+ ('login_timeout', False),
+ ('retry_on', False),
)
errors = config_fence_attr(params, fencedev, fence_name, **kw)
@@ -174,6 +182,10 @@ def val_virsh_fd(fencedev, fence_name, **kw):
('passwd', False),
('passwd_script', False),
('power_wait', False),
+ ('power_timeout', False),
+ ('shell_timeout', False),
+ ('login_timeout', False),
+ ('retry_on', False),
)
errors = config_fence_attr(params, fencedev, fence_name, **kw)
@@ -240,6 +252,10 @@ def val_sanbox2_fd(fencedev, fence_name, **kw):
('passwd', False),
('passwd_script', False),
('power_wait', False),
+ ('power_timeout', False),
+ ('shell_timeout', False),
+ ('login_timeout', False),
+ ('retry_on', False),
)
errors = config_fence_attr(params, fencedev, fence_name, **kw)
@@ -253,6 +269,10 @@ def val_bladecenter_fd(fencedev, fence_name, **kw):
('passwd', False),
('passwd_script', False),
('power_wait', False),
+ ('power_timeout', False),
+ ('shell_timeout', False),
+ ('login_timeout', False),
+ ('retry_on', False),
)
errors = config_fence_attr(params, fencedev, fence_name, **kw)
@@ -275,8 +295,11 @@ def val_vmware_soap_fd(fencedev, fence_name, **kw):
('login', True),
('passwd', False),
('passwd_script', False),
- ('separator', False),
('power_wait', False),
+ ('power_timeout', False),
+ ('shell_timeout', False),
+ ('login_timeout', False),
+ ('retry_on', False),
)
errors = config_fence_attr(params, fencedev, fence_name, **kw)
@@ -292,6 +315,10 @@ def val_vmware_fd(fencedev, fence_name, **kw):
('vmpasswd', False),
('vmpasswd_script', False),
('power_wait', False),
+ ('power_timeout', False),
+ ('shell_timeout', False),
+ ('login_timeout', False),
+ ('retry_on', False),
)
errors = config_fence_attr(params, fencedev, fence_name, **kw)
@@ -315,6 +342,10 @@ def val_lpar_fd(fencedev, fence_name, **kw):
('passwd_script', False),
('hmc_version', False),
('power_wait', False),
+ ('power_timeout', False),
+ ('shell_timeout', False),
+ ('login_timeout', False),
+ ('retry_on', False),
)
errors = config_fence_attr(params, fencedev, fence_name, **kw)
@@ -347,6 +378,11 @@ def val_rsa_fd(fencedev, fence_name, **kw):
('passwd_script', False),
('cmd_prompt', False),
('power_wait', False),
+ ('delay', False),
+ ('power_timeout', False),
+ ('shell_timeout', False),
+ ('login_timeout', False),
+ ('retry_on', False),
)
errors = config_fence_attr(params, fencedev, fence_name, **kw)
@@ -359,6 +395,13 @@ def val_rsb_fd(fencedev, fence_name, **kw):
('telnet_port', False),
('passwd', False),
('passwd_script', False),
+ ('cmd_prompt', False),
+ ('power_wait', False),
+ ('delay', False),
+ ('power_timeout', False),
+ ('shell_timeout', False),
+ ('login_timeout', False),
+ ('retry_on', False),
)
errors = config_fence_attr(params, fencedev, fence_name, **kw)
@@ -371,6 +414,7 @@ def val_eps_fd(fencedev, fence_name, **kw):
('passwd', False),
('passwd_script', False),
('hidden_page', False),
+ ('retry_on', False),
)
errors = config_fence_attr(params, fencedev, fence_name, **kw)
@@ -388,6 +432,11 @@ def val_drac5_fd(fencedev, fence_name, **kw):
('passwd', False),
('passwd_script', False),
('power_wait', False),
+ ('delay', False),
+ ('power_timeout', False),
+ ('shell_timeout', False),
+ ('login_timeout', False),
+ ('retry_on', False),
)
errors = config_fence_attr(params, fencedev, fence_name, **kw)
@@ -402,6 +451,7 @@ def val_drac_fd(fencedev, fence_name, **kw):
('passwd', False),
('passwd_script', False),
('drac_version', False),
+ ('delay', False),
)
errors = config_fence_attr(params, fencedev, fence_name, **kw)
@@ -426,6 +476,9 @@ def val_ipmilan_fd(fencedev, fence_name, **kw):
('lanplus', False),
('cipher', False),
('privlvl', False),
+ ('timeout', False),
+ ('power_wait', False),
+ ('delay', False),
)
errors = config_fence_attr(params, fencedev, fence_name, **kw)
@@ -439,6 +492,11 @@ def val_alom_fd(fencedev, fence_name, **kw):
('passwd', False),
('passwd_script', False),
('power_wait', False),
+ ('delay', False),
+ ('power_timeout', False),
+ ('shell_timeout', False),
+ ('login_timeout', False),
+ ('retry_on', False),
)
errors = config_fence_attr(params, fencedev, fence_name, **kw)
@@ -453,6 +511,10 @@ def val_ldom_fd(fencedev, fence_name, **kw):
('passwd_script', False),
('cmd_prompt', False),
('power_wait', False),
+ ('power_timeout', False),
+ ('shell_timeout', False),
+ ('login_timeout', False),
+ ('retry_on', False),
)
errors = config_fence_attr(params, fencedev, fence_name, **kw)
@@ -505,6 +567,10 @@ def val_ibmblade_fd(fencedev, fence_name, **kw):
('snmp_priv_passwd', False),
('snmp_priv_passwd_script', False),
('power_wait', False),
+ ('power_timeout', False),
+ ('shell_timeout', False),
+ ('login_timeout', False),
+ ('retry_on', False),
)
errors = config_fence_attr(params, fencedev, fence_name, **kw)
@@ -520,6 +586,10 @@ def val_hpblade_fd(fencedev, fence_name, **kw):
('passwd', False),
('passwd_script', False),
('power_wait', False),
+ ('power_timeout', False),
+ ('shell_timeout', False),
+ ('login_timeout', False),
+ ('retry_on', False),
)
errors = config_fence_attr(params, fencedev, fence_name, **kw)
@@ -540,6 +610,10 @@ def val_ifmib_fd(fencedev, fence_name, **kw):
('snmp_priv_passwd', False),
('snmp_priv_passwd_script', False),
('power_wait', False),
+ ('power_timeout', False),
+ ('shell_timeout', False),
+ ('login_timeout', False),
+ ('retry_on', False),
)
errors = config_fence_attr(params, fencedev, fence_name, **kw)
@@ -560,6 +634,10 @@ def val_cisco_mds_fd(fencedev, fence_name, **kw):
('snmp_priv_passwd', False),
('snmp_priv_passwd_script', False),
('power_wait', False),
+ ('power_timeout', False),
+ ('shell_timeout', False),
+ ('login_timeout', False),
+ ('retry_on', False),
)
errors = config_fence_attr(params, fencedev, fence_name, **kw)
@@ -575,6 +653,10 @@ def val_cisco_ucs_fd(fencedev, fence_name, **kw):
('ssl', False),
('suborg', False),
('power_wait', False),
+ ('power_timeout', False),
+ ('shell_timeout', False),
+ ('login_timeout', False),
+ ('retry_on', False),
)
errors = config_fence_attr(params, fencedev, fence_name, **kw)
@@ -603,6 +685,10 @@ def val_apc_snmp_fd(fencedev, fence_name, **kw):
('snmp_priv_passwd', False),
('snmp_priv_passwd_script', False),
('power_wait', False),
+ ('power_timeout', False),
+ ('shell_timeout', False),
+ ('login_timeout', False),
+ ('retry_on', False),
)
errors = config_fence_attr(params, fencedev, fence_name, **kw)
@@ -623,6 +709,10 @@ def val_intelmodular_fd(fencedev, fence_name, **kw):
('snmp_priv_passwd', False),
('snmp_priv_passwd_script', False),
('power_wait', False),
+ ('power_timeout', False),
+ ('shell_timeout', False),
+ ('login_timeout', False),
+ ('retry_on', False),
)
errors = config_fence_attr(params, fencedev, fence_name, **kw)
@@ -639,6 +729,11 @@ def val_ilo_mp_fd(fencedev, fence_name, **kw):
('identity_file', False),
('cmd_prompt', False),
('power_wait', False),
+ ('delay', False),
+ ('power_timeout', False),
+ ('shell_timeout', False),
+ ('login_timeout', False),
+ ('retry_on', False),
)
errors = config_fence_attr(params, fencedev, fence_name, **kw)
@@ -652,6 +747,11 @@ def val_ilo_fd(fencedev, fence_name, **kw):
('passwd', False),
('passwd_script', False),
('power_wait', False),
+ ('delay', False),
+ ('power_timeout', False),
+ ('shell_timeout', False),
+ ('login_timeout', False),
+ ('retry_on', False),
)
errors = config_fence_attr(params, fencedev, fence_name, **kw)
@@ -672,6 +772,10 @@ def val_ipdu_fd(fencedev, fence_name, **kw):
('snmp_priv_passwd', False),
('snmp_priv_passwd_script', False),
('power_wait', False),
+ ('power_timeout', False),
+ ('shell_timeout', False),
+ ('login_timeout', False),
+ ('retry_on', False),
)
errors = config_fence_attr(params, fencedev, fence_name, **kw)
@@ -692,6 +796,10 @@ def val_eaton_snmp_fd(fencedev, fence_name, **kw):
('snmp_priv_passwd', False),
('snmp_priv_passwd_script', False),
('power_wait', False),
+ ('power_timeout', False),
+ ('shell_timeout', False),
+ ('login_timeout', False),
+ ('retry_on', False),
)
errors = config_fence_attr(params, fencedev, fence_name, **kw)
@@ -706,6 +814,10 @@ def val_rhevm_fd(fencedev, fence_name, **kw):
('passwd_script', False),
('ssl', False),
('power_wait', False),
+ ('power_timeout', False),
+ ('shell_timeout', False),
+ ('login_timeout', False),
+ ('retry_on', False),
)
errors = config_fence_attr(params, fencedev, fence_name, **kw)
@@ -818,6 +930,7 @@ def val_apc_fi(fenceinst, parent_name, **kw):
('switch', False),
('secure', False),
('identity_file', False),
+ ('delay', False),
)
errors = config_fence_attr(params, fenceinst, parent_name, **kw)
@@ -828,6 +941,7 @@ def val_wti_fi(fenceinst, parent_name, **kw):
('port', True),
('secure', False),
('identity_file', False),
+ ('delay', False),
)
errors = config_fence_attr(params, fenceinst, parent_name, **kw)
@@ -838,6 +952,7 @@ def val_virsh_fi(fenceinst, parent_name, **kw):
('port', True),
('secure', False),
('identity_file', False),
+ ('delay', False),
)
errors = config_fence_attr(params, fenceinst, parent_name, **kw)
@@ -870,6 +985,7 @@ def val_gnbd_fi(fenceinst, parent_name, **kw):
def val_sanbox2_fi(fenceinst, parent_name, **kw):
params = (
('port', True),
+ ('delay', False),
)
errors = config_fence_attr(params, fenceinst, parent_name, **kw)
@@ -881,6 +997,7 @@ def val_bladecenter_fi(fenceinst, parent_name, **kw):
('switch', False),
('secure', False),
('identity_file', False),
+ ('delay', False),
)
errors = config_fence_attr(params, fenceinst, parent_name, **kw)
@@ -892,6 +1009,7 @@ def val_ipdu_fi(fenceinst, parent_name, **kw):
('switch', False),
('secure', False),
('identity_file', False),
+ ('delay', False),
)
errors = config_fence_attr(params, fenceinst, parent_name, **kw)
@@ -909,6 +1027,7 @@ def val_egenera_fi(fenceinst, parent_name, **kw):
params = (
('lpan', True),
('pserver', True),
+ ('delay', False),
)
errors = config_fence_attr(params, fenceinst, parent_name, **kw)
@@ -920,6 +1039,7 @@ def val_lpar_fi(fenceinst, parent_name, **kw):
('managed', True),
('secure', True),
('identity_file', False),
+ ('delay', False),
)
errors = config_fence_attr(params, fenceinst, parent_name, **kw)
@@ -936,6 +1056,7 @@ def val_bullpap_fi(fenceinst, parent_name, **kw):
def val_xvm_fi(fenceinst, parent_name, **kw):
params = (
('domain', True),
+ ('delay', False),
)
errors = config_fence_attr(params, fenceinst, parent_name, **kw)
@@ -944,6 +1065,7 @@ def val_xvm_fi(fenceinst, parent_name, **kw):
def val_virt_fi(fenceinst, parent_name, **kw):
params = (
('domain', True),
+ ('delay', False),
)
errors = config_fence_attr(params, fenceinst, parent_name, **kw)
@@ -954,6 +1076,7 @@ def val_vmware_soap_fi(fenceinst, parent_name, **kw):
('ssl', False),
('port', False),
('uuid', False),
+ ('delay', False),
)
errors = config_fence_attr(params, fenceinst, parent_name, **kw)
@@ -966,6 +1089,7 @@ def val_vmware_fi(fenceinst, parent_name, **kw):
('port', True),
('secure', False),
('identity_file', False),
+ ('delay', False),
)
errors = config_fence_attr(params, fenceinst, parent_name, **kw)
@@ -984,6 +1108,7 @@ def val_ldom_fi(fenceinst, parent_name, **kw):
('port', True),
('secure', False),
('identity_file', False),
+ ('delay', False),
)
errors = config_fence_attr(params, fenceinst, parent_name, **kw)
@@ -992,6 +1117,7 @@ def val_ldom_fi(fenceinst, parent_name, **kw):
def val_cisco_mds_fi(fenceinst, parent_name, **kw):
params = (
('port', True),
+ ('delay', False),
)
errors = config_fence_attr(params, fenceinst, parent_name, **kw)
@@ -1000,6 +1126,7 @@ def val_cisco_mds_fi(fenceinst, parent_name, **kw):
def val_cisco_ucs_fi(fenceinst, parent_name, **kw):
params = (
('port', True),
+ ('delay', False),
)
errors = config_fence_attr(params, fenceinst, parent_name, **kw)
@@ -1008,6 +1135,7 @@ def val_cisco_ucs_fi(fenceinst, parent_name, **kw):
def val_eps_fi(fenceinst, parent_name, **kw):
params = (
('port', True),
+ ('delay', False),
)
errors = config_fence_attr(params, fenceinst, parent_name, **kw)
@@ -1016,6 +1144,7 @@ def val_eps_fi(fenceinst, parent_name, **kw):
def val_ibmblade_fi(fenceinst, parent_name, **kw):
params = (
('port', True),
+ ('delay', False),
)
errors = config_fence_attr(params, fenceinst, parent_name, **kw)
@@ -1026,6 +1155,7 @@ def val_hpblade_fi(fenceinst, parent_name, **kw):
('port', True),
('secure', False),
('identity_file', False),
+ ('delay', False),
)
errors = config_fence_attr(params, fenceinst, parent_name, **kw)
@@ -1034,6 +1164,7 @@ def val_hpblade_fi(fenceinst, parent_name, **kw):
def val_ifmib_fi(fenceinst, parent_name, **kw):
params = (
('port', True),
+ ('delay', False),
)
errors = config_fence_attr(params, fenceinst, parent_name, **kw)
@@ -1042,6 +1173,7 @@ def val_ifmib_fi(fenceinst, parent_name, **kw):
def val_apc_snmp_fi(fenceinst, parent_name, **kw):
params = (
('port', True),
+ ('delay', False),
)
errors = config_fence_attr(params, fenceinst, parent_name, **kw)
@@ -1050,6 +1182,7 @@ def val_apc_snmp_fi(fenceinst, parent_name, **kw):
def val_intelmodular_fi(fenceinst, parent_name, **kw):
params = (
('port', True),
+ ('delay', False),
)
errors = config_fence_attr(params, fenceinst, parent_name, **kw)
@@ -1067,6 +1200,7 @@ def val_scsi_fi(fenceinst, parent_name, **kw):
def val_rhevm_fi(fenceinst, parent_name, **kw):
params = (
('port', True),
+ ('delay', False),
)
errors = config_fence_attr(params, fenceinst, parent_name, **kw)
@@ -1075,10 +1209,12 @@ def val_rhevm_fi(fenceinst, parent_name, **kw):
def val_eaton_snmp_fi(fenceinst, parent_name, **kw):
params = (
('port', True),
+ ('delay', False),
)
errors = config_fence_attr(params, fenceinst, parent_name, **kw)
return errors
+
def val_noop_fi(fenceinst, parent_name, **kw):
return []
11 years, 5 months
[luci] luci: additional fix for controller vs. unicode
by Jan Pokorný
commit f17f281f7e10d5bd4ffda4cd35a061626188d703
Author: Jan Pokorný <jpokorny(a)redhat.com>
Date: Tue Dec 4 18:37:47 2012 +0100
luci: additional fix for controller vs. unicode
Resolves: rhbz#807344
Signed-off-by: Jan Pokorný <jpokorny(a)redhat.com>
luci/controllers/cluster.py | 11 +++++------
luci/lib/helpers.py | 9 ++++++++-
2 files changed, 13 insertions(+), 7 deletions(-)
---
diff --git a/luci/controllers/cluster.py b/luci/controllers/cluster.py
index 3035306..6e09e2f 100644
--- a/luci/controllers/cluster.py
+++ b/luci/controllers/cluster.py
@@ -13,7 +13,7 @@ from tg import request, expose, redirect, flash, app_globals, tmpl_context, requ
# third party imports
from repoze.what.predicates import not_anonymous, in_any_group, is_user, Any, NotAuthorizedError
-from luci.lib.helpers import quote_plus, ugettext as _
+from luci.lib.helpers import quote_plus, unquote_plus, ugettext as _
# project specific imports
from luci.lib.base import BaseController
@@ -28,7 +28,6 @@ from luci.validation.validate_resource import validate_clusvc_form, validate_res
from luci.lib.ClusterConf.Method import Method
from luci.lib.ClusterConf.Unfence import Unfence
from luci.validation.validate_fence import validate_fenceinstance
-from urllib import unquote_plus
import logging
log = logging.getLogger(__name__)
@@ -387,11 +386,11 @@ class IndividualClusterController(BaseController):
if 'MultiAction' in kw:
kw["name"] = ""
command = kw['MultiAction']
- cur_list = [x for x in kw if kw[x] == 'on' in kw[x]]
+ cur_list = [unquote_plus(x) for x in kw if kw[x] == 'on' in kw[x]]
else:
obj_name = kw.get('name')
if obj_name:
- cur_list = [ obj_name ]
+ cur_list = [ unquote_plus(obj_name) ]
if len(cur_list) < 1:
flash(_('No nodes were selected'),
status='error')
@@ -959,11 +958,11 @@ class IndividualClusterController(BaseController):
if 'MultiAction' in kw:
kw["name"] = ""
command = kw['MultiAction']
- cur_list = [x for x in kw if kw[x] == 'on' in kw[x]]
+ cur_list = [unquote_plus(x) for x in kw if kw[x] == 'on' in kw[x]]
else:
obj_name = kw.get('name')
if obj_name:
- cur_list = [ obj_name ]
+ cur_list = [ unquote_plus(obj_name) ]
if len(cur_list) < 1:
flash(_('No fence devices were selected'),
diff --git a/luci/lib/helpers.py b/luci/lib/helpers.py
index 93ca3c5..9794995 100644
--- a/luci/lib/helpers.py
+++ b/luci/lib/helpers.py
@@ -12,7 +12,8 @@ __all__ = ['singleton',
'relativeUrlSlashPrefix', 'relativeUrlList2Str']
from pylons.i18n import ugettext, lazy_ugettext
-from urllib import quote_plus as quote_plus_impl
+from urllib import (quote_plus as quote_plus_impl,
+ unquote_plus as unquote_plus_impl)
def singleton(cls):
@@ -58,3 +59,9 @@ def relativeUrlList2Str(*url_parts):
def quote_plus(s):
"""urllib's quote_plus, but works with unicode as well."""
return quote_plus_impl(s.encode('UTF-8') if isinstance(s, unicode) else s)
+
+
+def unquote_plus(s):
+ """urllib's unquote_plus, but return unicode."""
+ ret = unquote_plus_impl(s)
+ return ret if isinstance(ret, unicode) else unicode(ret, 'UTF-8')
11 years, 5 months