Author: kturner
Date: Thu Apr 18 23:10:07 2013
New Revision: 1469630
URL: http://svn.apache.org/r1469630
Log:
ACCUMULO-1323 fixed prompting for password in shell and added some option
checks for user, password, and token options.
Modified:
accumulo/trunk/ (props changed)
accumulo/trunk/assemble/ (props changed)
accumulo/trunk/core/ (props changed)
accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/Shell.java
accumulo/trunk/examples/ (props changed)
accumulo/trunk/fate/src/main/java/org/apache/accumulo/fate/ZooStore.java
(props changed)
accumulo/trunk/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooSession.java
(props changed)
accumulo/trunk/pom.xml (props changed)
accumulo/trunk/server/ (props changed)
accumulo/trunk/src/ (props changed)
Propchange: accumulo/trunk/
------------------------------------------------------------------------------
Merged /accumulo/branches/1.5:r1469629
Propchange: accumulo/trunk/assemble/
------------------------------------------------------------------------------
Merged /accumulo/branches/1.5/assemble:r1469629
Propchange: accumulo/trunk/core/
------------------------------------------------------------------------------
Merged /accumulo/branches/1.5/core:r1469629
Modified:
accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/Shell.java
URL:
http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/Shell.java?rev=1469630&r1=1469629&r2=1469630&view=diff
==============================================================================
---
accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/Shell.java
(original)
+++
accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/Shell.java
Thu Apr 18 23:10:07 2013
@@ -257,6 +257,18 @@ public class Shell extends ShellOptions
// process default parameters if unspecified
try {
+ if (loginOptions != null && !cl.hasOption(tokenOption.getOpt()))
+ throw new IllegalArgumentException("Must supply '-" +
tokenOption.getOpt() + "' option with '-" + loginOption.getOpt() + "' option");
+
+ if (loginOptions == null && cl.hasOption(tokenOption.getOpt()))
+ throw new IllegalArgumentException("Must supply '-" +
loginOption.getOpt() + "' option with '-" + tokenOption.getOpt() + "' option");
+
+ if (passw != null && cl.hasOption(tokenOption.getOpt()))
+ throw new IllegalArgumentException("Can not supply '-" +
passwOption.getOpt() + "' option with '-" + tokenOption.getOpt() + "' option");
+
+ if (user == null)
+ throw new MissingArgumentException(usernameOption);
+
if (loginOptions != null && cl.hasOption(tokenOption.getOpt())) {
Properties props = new Properties();
for (String loginOption : loginOptions)
@@ -286,9 +298,14 @@ public class Shell extends ShellOptions
}
if (this.token == null) {
+ passw = readMaskedLine("Password: ", '*');
+ if (passw != null)
+ this.token = new PasswordToken(passw);
+ }
+
+ if (this.token == null) {
reader.printNewline();
- configError = true;
- return true;
+ throw new MissingArgumentException("No password or token option
supplied");
} // user canceled
this.setTableName("");
Propchange: accumulo/trunk/examples/
------------------------------------------------------------------------------
Merged /accumulo/branches/1.5/examples:r1469629
Propchange:
accumulo/trunk/fate/src/main/java/org/apache/accumulo/fate/ZooStore.java
------------------------------------------------------------------------------
Merged
/accumulo/branches/1.5/fate/src/main/java/org/apache/accumulo/fate/ZooStore.java:r1469629
Propchange:
accumulo/trunk/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooSession.java
------------------------------------------------------------------------------
Merged
/accumulo/branches/1.5/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooSession.java:r1469629
Propchange: accumulo/trunk/pom.xml
------------------------------------------------------------------------------
Merged /accumulo/branches/1.5/pom.xml:r1469629
Propchange: accumulo/trunk/server/
------------------------------------------------------------------------------
Merged /accumulo/branches/1.5/server:r1469629
Propchange: accumulo/trunk/src/
------------------------------------------------------------------------------
Merged /accumulo/branches/1.5/src:r1469629