Avoids removing /

pull/80034/head
Eri Bastos 2 years ago
parent 72c59cfd98
commit fab495f4df

@ -517,6 +517,9 @@ def execute_diff_peek(path):
def ensure_absent(path): def ensure_absent(path):
if path == '/':
raise AnsibleModuleError(results={'msg': "Refusing to delete /"})
b_path = to_bytes(path, errors='surrogate_or_strict') b_path = to_bytes(path, errors='surrogate_or_strict')
prev_state = get_state(b_path) prev_state = get_state(b_path)
result = {} result = {}

Loading…
Cancel
Save