blob: 2f261aa1b3de4da4388bcd583758d3bc4c45ceca [file] [log] [blame]
Stanislav Riazanove898ea82018-12-24 17:44:43 +04001import logging
2
3logger = logging.getLogger(__name__)
4
5def __virtual__():
6 '''
7 Only load if jenkins_common module exist.
8 '''
9 if 'jenkins_common.call_groovy_script' not in __salt__:
10 return (
11 False,
12 'The jenkins_flowdurability state module cannot be loaded: '
13 'jenkins_common not found')
14 return True
15
16
17def flowdurability(name, flowdurabilitylevel):
18 """
19 Jenkins workflow plugin flow durability level config state method
20
21 :flowdurabilitylevel: Flow Durability Level:
22 MAX_SURVIVABILITY
23 PERFORMANCE_OPTIMIZED
24 SURVIVABLE_NONATOMIC
25 :returns: salt-specified state dict
26 """
27
28 template = __salt__['jenkins_common.load_template'](
29 'salt://jenkins/files/groovy/flowdurability.template',
30 __env__)
31
32 return __salt__['jenkins_common.api_call'](name, template,
33 ['CHANGED', 'EXISTS'],
34 {'flowdurabilitylevel': flowdurabilitylevel},
35 'FlowDurabilityLevel config')