diff -ur a/luci/cluster/resource-form-macros b/luci/cluster/resource-form-macros --- a/luci/cluster/resource-form-macros 2010-09-27 04:00:44.000000000 -0400 +++ b/luci/cluster/resource-form-macros 2010-09-27 04:34:54.000000000 -0400 @@ -32,7 +32,29 @@ <td tal:define="isubtree res/attrs/__independent_subtree|nothing"> <input class="vanilla" type="checkbox" name="__independent_subtree" - tal:attributes="checked python:(isubtree in ['1', 'true', 'True', True, 1]) and 'checked' or None" /> + tal:attributes="checked python:(isubtree in ['1', 1]) and 'checked' or None" /> + </td> + </tr> + <tr> + <td>This resource is non-critical</td> + <td tal:define="isubtree res/attrs/__independent_subtree|nothing"> + <input class="vanilla" type="checkbox" + name="__independent_subtree_noncritical" + tal:attributes="checked python:(isubtree in ['2', 2]) and 'checked' or None" /> + </td> + </tr> + <tr> + <td>Maximum number of restart failures before giving up<br>(applies only for non-critical resources)</td> + <td> + <input type="text" name="__max_restarts" size="3" + tal:attributes="value res/attrs/__max_restarts|nothing" /> + </td> + </tr> + <tr> + <td>Restart expire time<br>(applies only for non-critical resources)</td> + <td> + <input type="text" name="__restart_expire_time" size="3" + tal:attributes="value res/attrs/__restart_expire_time|nothing" /> </td> </tr> </table> diff -ur a/luci/site/luci/Extensions/LuciValidation.py b/luci/site/luci/Extensions/LuciValidation.py --- a/luci/site/luci/Extensions/LuciValidation.py 2010-09-27 04:00:44.000000000 -0400 +++ b/luci/site/luci/Extensions/LuciValidation.py 2010-09-27 04:32:31.000000000 -0400 @@ -390,6 +390,29 @@ resObj.addAttribute('__independent_subtree', '1') else: resObj.removeAttribute('__independent_subtree') + + if dummy_form.has_key('__independent_subtree_noncritical'): + resObj.addAttribute('__independent_subtree', '2') + + if dummy_form.has_key('__max_restarts'): + try: + resObj.addAttribute('__max_restarts', str(int(dummy_form['__max_restarts']))) + except: + resObj.removeAttribute('__max_restarts') + else: + resObj.removeAttribute('__max_restarts') + + if dummy_form.has_key('__restart_expire_time'): + try: + resObj.addAttribute('__restart_expire_time', str(int(dummy_form['__restart_expire_time']))) + except: + resObj.removeAttribute('__restart_expire_time') + else: + resObj.removeAttribute('__restart_expire_time') + else: + resObj.removeAttribute('__restart_expire_time') + resObj.removeAttribute('__max_restarts') + form_hash[form_id]['obj'] = resObj if len(errors) > 0: