mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-04 11:58:52 +00:00
Build System: Enable python3 compatibility.
* Consistently use spaces in rest-api-templates/asterisk_processor.py. * Exclude third-party from docs/full-en_US.xml. * Add docs/full-en_US.xml to .gitignore. * Use list() to convert python3 view. * Use python3 print function. * Replace cmp() with equivalent equation. * Replace reference to out of scope subtype variable with name parameter. * Use unescaping triple bracket notation in mustache templates where needed. This causes behavior of Python2 to be maintained when using Python3. * Fix references to has_websocket / is_websocket in res_ari_resource.c.mustache. * Update calculation of has_websocket to use any(). * Use unicode mode for writing output file in transform.py. * Replace 'from swagger_model import *' with explicit import of required symbols. I have not tested spandspflow2pcap.py or voicemailpwcheck.py, only the print syntax has been fixed. Change-Id: If5c5b556a2800d41a3e2cfef080ac2e151178c33
This commit is contained in:
@@ -46,20 +46,20 @@ mailbox, context, old_pw, new_pw = sys.argv[1:5]
|
||||
|
||||
# Enforce a password length of at least 6 characters
|
||||
if len(new_pw) < REQUIRED_LENGTH:
|
||||
print "INVALID: Password is too short (%d) - must be at least %d" % \
|
||||
(len(new_pw), REQUIRED_LENGTH)
|
||||
print("INVALID: Password is too short (%d) - must be at least %d" % \
|
||||
(len(new_pw), REQUIRED_LENGTH))
|
||||
sys.exit(0)
|
||||
|
||||
for regex, error in REGEX_BLACKLIST:
|
||||
if re.search(regex, new_pw):
|
||||
print "INVALID: %s" % error
|
||||
print("INVALID: %s" % error)
|
||||
sys.exit(0)
|
||||
|
||||
for pw in PW_BLACKLIST:
|
||||
if new_pw.find(pw) != -1:
|
||||
print "INVALID: %s is forbidden in a password" % pw
|
||||
print("INVALID: %s is forbidden in a password" % pw)
|
||||
sys.exit(0)
|
||||
|
||||
print "VALID"
|
||||
print("VALID")
|
||||
|
||||
sys.exit(0)
|
||||
|
Reference in New Issue
Block a user