Skip to content

Commit

Permalink
fix password format checking
Browse files Browse the repository at this point in the history
  • Loading branch information
Zengwen Yuan committed Oct 9, 2019
1 parent c493558 commit 4802f9f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions rcs_client_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,14 @@ def validate(self):
if not self.password:
log.warning("No password provided, using default demo password.")
self.password = CONST.DEMO_SIP_PWD
else:
try:
assert re.match(CONST.REGEX_SIP_PASSWORD, str(self.password)) is not None
except AssertionError as ae:
log.warning("Illegal character or wrong format in the password provided!")
log.warning("Using default demo password: {pwd}".format(pwd = CONST.DEMO_SIP_PWD))
self.password = CONST.DEMO_SIP_PWD


def add_arguments(self):
self.parser.add_argument('-u',
Expand Down

0 comments on commit 4802f9f

Please sign in to comment.