saltstack / salt

@@ -547,7 +547,7 @@
Loading
547 547
                'tgt_type': tgt_type,
548 548
                'ret': ret,
549 549
                'batch': batch,
550 -
                'failhard': kwargs.get('failhard', False),
550 +
                'failhard': kwargs.get('failhard', self.opts.get('failhard', False)),
551 551
                'raw': kwargs.get('raw', False)}
552 552
553 553
        if 'timeout' in kwargs:

@@ -254,6 +254,9 @@
Loading
254 254
                    data['ret']['retcode'] = data['retcode']
255 255
                    if self.opts.get('failhard') and data['ret']['retcode'] > 0:
256 256
                        failhard = True
257 +
                else:
258 +
                    if self.opts.get('failhard') and data['retcode'] > 0:
259 +
                        failhard = True
257 260
258 261
                if self.opts.get('raw'):
259 262
                    ret[minion] = data

@@ -128,6 +128,7 @@
Loading
128 128
        queue=False,
129 129
        subset=None,
130 130
        orchestration_jid=None,
131 +
        failhard=None,
131 132
        **kwargs):
132 133
    '''
133 134
    Invoke a state run on a given target
@@ -221,6 +222,11 @@
Loading
221 222
222 223
        .. versionadded:: 2017.7.0
223 224
225 +
    failhard
226 +
        pass failhard down to the executing state
227 +
228 +
        .. versionadded:: 2019.2.2
229 +
224 230
    Examples:
225 231
226 232
    Run a list of sls files via :py:func:`state.sls <salt.state.sls>` on target
@@ -311,9 +317,13 @@
Loading
311 317
312 318
    if batch is not None:
313 319
        cmd_kw['batch'] = six.text_type(batch)
320 +
314 321
    if subset is not None:
315 322
        cmd_kw['subset'] = subset
316 323
324 +
    if failhard is True or __opts__.get('failhard'):
325 +
        cmd_kw['failhard'] = True
326 +
317 327
    masterless = __opts__['__role'] == 'minion' and \
318 328
                 __opts__['file_client'] == 'local'
319 329
    if not masterless:
@@ -428,6 +438,7 @@
Loading
428 438
        timeout=None,
429 439
        batch=None,
430 440
        subset=None,
441 +
        failhard=None,
431 442
        **kwargs):  # pylint: disable=unused-argument
432 443
    '''
433 444
    Execute a single module function on a remote minion via salt or salt-ssh
@@ -477,6 +488,11 @@
Loading
477 488
478 489
        .. versionadded:: 2017.7.0
479 490
491 +
    failhard
492 +
        pass failhard down to the executing state
493 +
494 +
        .. versionadded:: 2019.2.2
495 +
480 496
    '''
481 497
    func_ret = {'name': name,
482 498
                'changes': {},
@@ -502,6 +518,9 @@
Loading
502 518
    cmd_kw['expect_minions'] = expect_minions
503 519
    cmd_kw['_cmd_meta'] = True
504 520
521 +
    if failhard is True or __opts__.get('failhard'):
522 +
        cmd_kw['failhard'] = True
523 +
505 524
    if ret_config:
506 525
        cmd_kw['ret_config'] = ret_config
507 526
Files Coverage
salt 38.84%
tests/integration/files/log_handlers/runtests_log_handler.py 51.25%
Project Totals (1578 files) 38.84%
254
debian9 py3 zeromq
252
ubuntu1604 py3 zeromq
254
centos6 py2 zeromq
260
windows2019 py2 zeromq
250
centos7 py2 zeromq
253
centos7 py2 zeromq
246
windows2019 py3 zeromq
254
windows2016 py3 zeromq
258
ubuntu1604 py3 zeromq
258
ubuntu1604 py2 zeromq
269
centos7 py3 zeromq
255
centos7 py3 zeromq
253
ubuntu1804 py2 zeromq
10
debian8 py2 zeromq
10
ubuntu1804 py2 zeromq
255
ubuntu1604 py2 zeromq
255
ubuntu1604 py2 tcp
254
ubuntu1604 py2 zeromq
1
codecov:
2
  ci:
3
    - drone.saltstack.com
4
    - jenkinsci.saltstack.com
5

6
  branch: 2019.2
7

8
  notify:
9
    require_ci_to_pass: no
10

11
ignore:
12
  - ^*.py$
13
  - doc/.*
14
  - tests/.*
15

16
coverage:
17
  round: up
18
  range: 70..100
19
  precision: 2
20

21
  status:
22
      project:                   # measuring the overall project coverage
23
        default:
24
          enabled: yes           # must be yes|true to enable this status
25
          if_no_uploads: error   # will post commit status of "error" if no coverage reports we uploaded
26
                                 # options: success, error, failure
27
          if_not_found: success  # if parent is not found report status as success, error, or failure
28
          if_ci_failed: success  # if ci fails report status as success, error, or failure
29

30
      patch:                     # pull requests only: this commit status will measure the
31
                                 # entire pull requests Coverage Diff. Checking if the lines
32
                                 # adjusted are covered at least X%.
33
        default:
34
          enabled: no              # must be yes|true to enable this status
35
          target: 80%              # specify the target "X%" coverage to hit
36
          if_no_uploads: error     # will post commit status of "error" if no coverage reports we uploaded
37
                                   # options: success, error, failure
38
          if_not_found: success
39
          if_ci_failed: success
40

41
      changes:                   # if there are any unexpected changes in coverage
42
        default:
43
          enabled: no            # must be yes|true to enable this status
44
          if_no_uploads: success
45
          if_not_found: success
46
          if_ci_failed: success
47

48
# No commends because we're not yet running the full test suite on PRs
49
comment: off
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.