Yair Zaslavsky has posted comments on this change.

Change subject: core: Password expired should be able to contain non URL 
messages.
......................................................................


Patch Set 3:

(5 comments)

http://gerrit.ovirt.org/#/c/23799/3/backend/manager/tools/src/main/java/org/ovirt/engine/core/domains/ManageDomains.java
File 
backend/manager/tools/src/main/java/org/ovirt/engine/core/domains/ManageDomains.java:

Line 352:             return null;
Line 353:         }
Line 354: 
Line 355:         String changePasswordMsgStr =
Line 356:                 readInteractively("Please enter message or URL to 
appear when user tries to login with an expired password.\n",
> Shouldn't this prompt end with ":" and without a new line? Otherwise we are
I agree.
Line 357:                         false);
Line 358: 
Line 359:         if (changePasswordMsgStr.indexOf("http") == 0 || 
changePasswordMsgStr.indexOf("https") == 0) {
Line 360:             try {


Line 398:     }
Line 399: 
Line 400:     private String readInteractively(String prompt, boolean 
isPassword) {
Line 401:         String value = null;
Line 402:         while (StringUtils.isBlank(value)) {
> This call to "isBlank" is always checking null.
why? I fill it with values that are read from the STDIN... what am I missing 
here?
I tested and did not get into an infinite loop...
Line 403:             System.out.print(prompt);
Line 404:             if (isPassword) {
Line 405:                 value = new String(System.console().readPassword());
Line 406:             } else {


Line 399: 
Line 400:     private String readInteractively(String prompt, boolean 
isPassword) {
Line 401:         String value = null;
Line 402:         while (StringUtils.isBlank(value)) {
Line 403:             System.out.print(prompt);
> This prompt should go to the console as well:
Thanks, I'll fix that.
Line 404:             if (isPassword) {
Line 405:                 value = new String(System.console().readPassword());
Line 406:             } else {
Line 407:                 value = System.console().readLine();


Line 539:         String changePasswordUrlStr = null;
Line 540:         try {
Line 541:             changePasswordUrlStr = getChangePasswordMsg(parser);
Line 542:         } catch (UnsupportedEncodingException e) {
Line 543:             log.error("Error in encoding the change passwsord 
message. ", e);
> s/passsord/password/
Done
Line 544:         }
Line 545: 
Line 546:         String currentAdUserNameEntry = 
configurationProvider.getConfigValue(ConfigValues.AdUserName);
Line 547:         String currentAdUserPasswordEntry = 
configurationProvider.getConfigValue(ConfigValues.AdUserPassword);


Line 725:         if (parser.hasArg(Arguments.changePasswordMsg.name())) {
Line 726:             try {
Line 727:                 changePaswordUrlEntry.setValueForDomain(domainName, 
getChangePasswordMsg(parser));
Line 728:             } catch (UnsupportedEncodingException e) {
Line 729:                 log.error("Error in encoding the change passwsord 
message. ", e);
> s/passwsord/password/
Done
Line 730:             }
Line 731:         }
Line 732: 
Line 733:         testConfiguration(domainName,


-- 
To view, visit http://gerrit.ovirt.org/23799
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I9f656f38f7f48e169ed01ad084d7f424e5c749f3
Gerrit-PatchSet: 3
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Yair Zaslavsky <yzasl...@redhat.com>
Gerrit-Reviewer: Juan Hernandez <juan.hernan...@redhat.com>
Gerrit-Reviewer: Yair Zaslavsky <yzasl...@redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to