Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion osism/tasks/conductor/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
import urllib3
import yaml

DELETE_SENTINEL = "DELETE"


def deep_compare(a, b, updates):
"""
Expand All @@ -31,7 +33,7 @@ def deep_compare(a, b, updates):

def deep_merge(a, b):
for key, value in b.items():
if value == "DELETE":
if value == DELETE_SENTINEL:
# NOTE: Use special string to remove keys
a.pop(key, None)
elif (
Expand Down
11 changes: 9 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,15 @@ class VaultLib:
def __init__(self, *args, **kwargs):
pass

def is_encrypted(self, *args, **kwargs):
return False
def is_encrypted(self, data, *args, **kwargs):
if isinstance(data, str):
data = data.encode("utf-8", errors="ignore")
return isinstance(data, (bytes, bytearray)) and bytes(data).startswith(
b"$ANSIBLE_VAULT"
)

def decrypt(self, *args, **kwargs):
return b""

class VaultSecret:
def __init__(self, *args, **kwargs):
Expand Down
Loading