Univention Bugzilla – Attachment 8657 Details for
Bug 42267
Integrate self service into 4.2 web structure + improve usability
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
handle no password file
42267_password_file_unset.patch (text/plain), 1.63 KB, created by
Daniel Tröder
on 2017-03-27 15:26:53 CEST
(
hide
)
Description:
handle no password file
Filename:
MIME Type:
Creator:
Daniel Tröder
Created:
2017-03-27 15:26:53 CEST
Size:
1.63 KB
patch
obsolete
>Index: umc/python/passwordreset/sending/send_sms.py >=================================================================== >--- umc/python/passwordreset/sending/send_sms.py (Revision 78343) >+++ umc/python/passwordreset/sending/send_sms.py (Arbeitskopie) >@@ -68,16 +68,19 @@ > raise ValueError("SendSMS: UCR umc/self-service/passwordreset/sms/country_code must contain a number.") > > self.password_file = self.ucr.get("umc/self-service/passwordreset/sms/password_file") >- try: >- with open(self.password_file) as pw_file: >- self.sms_username, self.sms_password = pw_file.readline().strip().split(":") >- except ValueError as ve: >- self.log("SendSMS: Format of sms secrets file ({}) is 'username:password'. Error: {}").format(self.password_file, ve) >- self.log("SendSMS: Format error in sms secrets file ({}): {}".format(self.password_file, ve)) >- raise >- except (OSError, IOError) as e: >- self.log("SendSMS: Error reading sms secrets file ({}): {}".format(self.password_file, e)) >- raise >+ if self.password_file: >+ try: >+ with open(self.password_file) as pw_file: >+ self.sms_username, self.sms_password = pw_file.readline().strip().split(":") >+ except ValueError as ve: >+ self.log("SendSMS: Format of sms secrets file ({}) is 'username:password'. Error: {}").format(self.password_file, ve) >+ self.log("SendSMS: Format error in sms secrets file ({}): {}".format(self.password_file, ve)) >+ raise >+ except (OSError, IOError) as e: >+ self.log("SendSMS: Error reading sms secrets file ({}): {}".format(self.password_file, e)) >+ raise >+ else: >+ self.sms_username, self.sms_password = "", "" > > @staticmethod > def send_method():
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 42267
:
7983
|
8595
| 8657