def randpw(): while True: pw = random_string(12, string.ascii_letters + string.digits + "_-!;") try: validate(pw) except ValueError: continue return pw
def randpw(): while True: pw = random_string( 12, string.ascii_letters + string.digits + "_-!;") try: validate(pw) except ValueError: continue return pw
def run(self): if os.path.exists(self.dest): self.crypted_password = self.environ.parse_auth(self.dest).password else: salt = random_string(2, string.ascii_letters + string.digits + "_-!;") password = self.environ.parse_auth(self.interpolate('{{env.config.get("general", "admin_info_filename")}}')).password self.crypted_password = crypt(password, salt) super(EnsureHtpasswdFile, self).run()
def run(self): if os.path.exists(self.dest): self.crypted_password = self.environ.parse_auth(self.dest).password else: salt = random_string(2, string.ascii_letters + string.digits + "_-!;") password = self.environ.parse_auth( self.interpolate( '{{env.config.get("general", "admin_info_filename")}}') ).password self.crypted_password = crypt(password, salt) super(EnsureHtpasswdFile, self).run()