import re
import binascii
import yaml
+import string
+import secrets
from enum import Enum
from juju.machine import Machine
from juju.application import Application
yaml_text = obj_to_yaml(obj)
# parse to dict
return yaml.load(yaml_text, Loader=yaml.Loader)
+
+
+def generate_random_alfanum_string(size: int) -> str:
+ """
+ Generate random alfa-numeric string with a size given by argument
+ :param size:
+ :return: random generated string
+ """
+
+ return "".join(
+ secrets.choice(string.ascii_letters + string.digits) for i in range(size)
+ )