| import logging |
| |
| logger = logging.getLogger(__name__) |
| |
| def __virtual__(): |
| ''' |
| Only load if jenkins_common module exist. |
| ''' |
| if 'jenkins_common.call_groovy_script' not in __salt__: |
| return ( |
| False, |
| 'The jenkins_flowdurability state module cannot be loaded: ' |
| 'jenkins_common not found') |
| return True |
| |
| |
| def flowdurability(name, flowdurabilitylevel): |
| """ |
| Jenkins workflow plugin flow durability level config state method |
| |
| :flowdurabilitylevel: Flow Durability Level: |
| MAX_SURVIVABILITY |
| PERFORMANCE_OPTIMIZED |
| SURVIVABLE_NONATOMIC |
| :returns: salt-specified state dict |
| """ |
| |
| template = __salt__['jenkins_common.load_template']( |
| 'salt://jenkins/files/groovy/flowdurability.template', |
| __env__) |
| |
| return __salt__['jenkins_common.api_call'](name, template, |
| ['CHANGED', 'EXISTS'], |
| {'flowdurabilitylevel': flowdurabilitylevel}, |
| 'FlowDurabilityLevel config') |