You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by da...@apache.org on 2017/04/07 21:04:21 UTC

[1/2] incubator-trafficcontrol git commit: Term::ReadPassword fix: TC-185

Repository: incubator-trafficcontrol
Updated Branches:
  refs/heads/master 7aa3abc66 -> dd3887358


Term::ReadPassword fix: TC-185


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/290e4bc0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/290e4bc0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/290e4bc0

Branch: refs/heads/master
Commit: 290e4bc082df416a727490dfc4a8210b3ff5d778
Parents: 7aa3abc
Author: Jeff Martin <ma...@gmail.com>
Authored: Fri Apr 7 13:31:52 2017 -0400
Committer: Dan Kirkwood <da...@gmail.com>
Committed: Fri Apr 7 13:24:33 2017 -0600

----------------------------------------------------------------------
 traffic_ops/build/traffic_ops.spec      |  2 +-
 traffic_ops/install/lib/InstallUtils.pm | 36 +++++++++++++++-------------
 2 files changed, 20 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/290e4bc0/traffic_ops/build/traffic_ops.spec
----------------------------------------------------------------------
diff --git a/traffic_ops/build/traffic_ops.spec b/traffic_ops/build/traffic_ops.spec
index a4d63d2..7d359a1 100644
--- a/traffic_ops/build/traffic_ops.spec
+++ b/traffic_ops/build/traffic_ops.spec
@@ -35,7 +35,7 @@ AutoReqProv:      no
 Requires:         cpanminus, expat-devel, gcc-c++, libcurl, libpcap-devel, mkisofs, tar
 Requires:         openssl-devel, perl, perl-core, perl-DBD-Pg, perl-DBI, perl-Digest-SHA1
 Requires:	  libidn-devel, libcurl-devel
-Requires:         perl-JSON, perl-libwww-perl, perl-Test-CPAN-Meta, perl-WWW-Curl
+Requires:         perl-JSON, perl-libwww-perl, perl-Test-CPAN-Meta, perl-WWW-Curl, perl-TermReadKey
 Requires(pre):    /usr/sbin/useradd, /usr/bin/getent
 Requires(postun): /usr/sbin/userdel
 

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/290e4bc0/traffic_ops/install/lib/InstallUtils.pm
----------------------------------------------------------------------
diff --git a/traffic_ops/install/lib/InstallUtils.pm b/traffic_ops/install/lib/InstallUtils.pm
index 57f2e14..1b9cf72 100644
--- a/traffic_ops/install/lib/InstallUtils.pm
+++ b/traffic_ops/install/lib/InstallUtils.pm
@@ -34,7 +34,7 @@ package InstallUtils;
 # under the License.
 
 
-use Term::ReadPassword;
+use Term::ReadKey;
 use JSON;
 use IO::Pipe;
 use base qw{ Exporter };
@@ -172,25 +172,27 @@ sub promptUser {
     }
 
     if ( defined $noEcho && $noEcho ) {
-        my $response = read_password('');
-        if ( ( !defined $response || $response eq '' ) && ( defined $defaultValue && $defaultValue ne '' ) ) {
-            $response = $defaultValue;
-        }
-        return $response;
+        # Set echo mode to off via ReadMode 2
+        ReadMode 2;
     }
-    else {
-        $| = 1;
-        $_ = <STDIN>;
-        chomp;
 
-        if ("$defaultValue") {
-            return $_ ? $_ : $defaultValue;
-        }
-        else {
-            return $_;
-        }
-        return $_;
+    $| = 1;
+    $_ = <STDIN>;
+    chomp;
+
+    if ( defined $noEcho && $noEcho ) {
+        # Set echo mode to on via ReadMode 1
+        ReadMode 1;
+        # Print extra line because echo mode was off during the STDIN
+        print "\n";
+    }
+
+    if ("$defaultValue") {
+        return $_ ? $_ : $defaultValue;
     }
+
+    # If we have gotten here, return what is left
+    return $_;
 }
 
 sub promptRequired {


[2/2] incubator-trafficcontrol git commit: This closes #442

Posted by da...@apache.org.
This closes #442


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/dd388735
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/dd388735
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/dd388735

Branch: refs/heads/master
Commit: dd3887358e6dbc42b40b038a5b800493ed815b7d
Parents: 290e4bc
Author: Dan Kirkwood <da...@gmail.com>
Authored: Fri Apr 7 15:04:12 2017 -0600
Committer: Dan Kirkwood <da...@gmail.com>
Committed: Fri Apr 7 15:04:12 2017 -0600

----------------------------------------------------------------------

----------------------------------------------------------------------