Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix FAIL : ResponseError: NOAUTH Authentication required #1

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions RedisLibrary/RedisLibraryKeywords.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,22 @@
class RedisLibraryKeywords(object):

@keyword('Connect To Redis')
def connect_to_redis(self, redis_host, redis_port=6379, db=0): # pragma: no cover
def connect_to_redis(self, redis_host, redis_port=6379, db=0, redis_password=None): # pragma: no cover
"""Connect to the Redis server.

Arguments:
- redis_host: hostname or IP address of the Redis server.
- redis_port: Redis port number (default=6379)
- db: Redis keyspace number (default=0)
- redis_password: for authentication required

Return redis connection object

Examples:
| ${redis_conn}= | Connect To Redis | redis-dev.com | 6379 |
| ${redis_conn}= | Connect To Redis | redis-dev.com | 6379 | password
penn201500 marked this conversation as resolved.
Show resolved Hide resolved
"""
try:
redis_conn = redis.StrictRedis(host=redis_host, port=redis_port, db=db)
redis_conn = redis.StrictRedis(host=redis_host, port=redis_port, db=db, password=redis_password)
except Exception as ex:
logger.error(str(ex))
raise Exception(str(ex))
Expand Down