backups: Add test for adding ssh remotes

Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
This commit is contained in:
Joseph Nuthalapati committed 2019-07-03 12:42:02 +05:30
1 parent 95f9f5c712
commit d451b54286
2 files changed
+113

No files matched your search

+7
View File
@@ -120,6 +120,13 @@ class YAMLFile(object):
return os.stat(self.yaml_file).st_size == 0
def random_string(size=8):
"""Generate a random alphanumeric string."""
chars = (random.SystemRandom().choice(string.ascii_letters)
for _ in range(size))
return ''.join(chars)
def generate_password(size=32):
"""Generate a random password using ascii alphabet and digits."""
chars = (random.SystemRandom().choice(string.ascii_letters + string.digits)