Skip to content

Commit

Permalink
bug fix in password generation
Browse files Browse the repository at this point in the history
  • Loading branch information
usmannasir committed Sep 24, 2023
1 parent 48f328b commit 7972d16
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 17 deletions.
11 changes: 8 additions & 3 deletions install/randomPassword.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
import random

def generate_pass(length=14):
chars = string.ascii_uppercase + string.ascii_lowercase + string.digits
size = length
return ''.join(random.choice(chars) for x in range(size))
# chars = string.ascii_uppercase + string.ascii_lowercase + string.digits
# size = length
# return ''.join(random.choice(chars) for x in range(size))
import secrets
import string

alphabet = string.ascii_letters + string.digits
return ''.join(secrets.choice(alphabet) for _ in range(length))
19 changes: 5 additions & 14 deletions install/test.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
import subprocess
import secrets
import string


def installCertBot():
cmd = []

cmd.append("yum")
cmd.append("-y")
cmd.append("install")
cmd.append("certbot")

res = subprocess.call(cmd)


installCertBot()
alphabet = string.ascii_letters + string.digits
the_password = ''.join(secrets.choice(alphabet) for _ in range(14))
print(the_password)

0 comments on commit 7972d16

Please sign in to comment.