File: atexit.yml

package info (click to toggle)
python-mitogen 0.3.37-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,728 kB
  • sloc: python: 24,644; sh: 198; makefile: 74; perl: 19; ansic: 18
file content (31 lines) | stat: -rw-r--r-- 805 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# issue #397, #454: newer Ansibles rely on atexit to cleanup their temporary
# directories. Ensure atexit handlers calling shutil.rmtree() run during runner
# completion.

- name: integration/runner/atexit.yml
  hosts: test-targets
  gather_facts: false
  any_errors_fatal: false
  vars:
    path: /tmp/atexit-should-delete-this
  tasks:
    - name: Verify a run with a healthy atexit handler
      custom_python_run_script:
        script: |
          import atexit, os, shutil
          path = '{{path}}'
          os.mkdir(path, int('777', 8))
          atexit.register(shutil.rmtree, path)

    - name: Stat atexit file
      stat:
        path: "{{path}}"
      register: out

    - assert:
        that:
        - not out.stat.exists
        fail_msg: |
          out={{ out }}
  tags:
    - atexit