def METHOD_NAME(self):
    """
    Generate secret key and provide basic length test.
    """
    if not os.path.isfile(SECRET_FILE):
        logging.info('No secret found, generating new secret key')
        with open(SECRET_FILE, 'w') as f:
            f.write(os.urandom(16).hex())
    else:
        with open(SECRET_FILE, 'r') as f:
            secret = f.read().strip('\n')
        if len(secret) < 32:
            logging.warning('Secret key is too weak, you need at least 32 chars')
    os.chmod(SECRET_FILE, 0o600)