Permalink
Browse files

fixed login with instance id

  • Loading branch information...
1 parent 8e1eed2 commit 00d657bd26a73c698e867d2c1af6cc63689387a6 @carlosdotdanger committed Mar 14, 2011
Showing with 11 additions and 6 deletions.
  1. +3 −1 bin/pooper.sh
  2. +1 −1 config/log4j.properties
  3. +7 −4 src/com/lunabeat/pooper/commands/AppCommand.java
View
@@ -58,5 +58,7 @@ if [ "$1" == "login" ] ; then
else
COMMAND="$JAVA $JAVA_OPTS -jar $POOPER_JAR $1 $2 $3 $4 $5 $6"
fi
-
+#echo "COMMAND:"
+#echo "$COMMAND"
+#echo "--------"
exec $COMMAND
View
@@ -2,4 +2,4 @@ log4j.rootLogger=WARN, A1
log4j.appender.A1=org.apache.log4j.ConsoleAppender
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%d [%t] %-5p %c - %m%n
-log4j.com.lunabeat.dooper.HadoopCluster.logger=INFO, A1
+
@@ -483,14 +483,17 @@ private void createGroups(String clusterName) {
private void getLoginCommand(String target) {
String host = null;
HadoopCluster cluster = new HadoopCluster(target, _config);
- if(cluster.groupsExist())
+ if(cluster.groupsExist()){
if(cluster.getMaster() != null)
host = cluster.getMaster().getInstance().getPublicDnsName();
- else if(target.startsWith(ClusterConfig.EC2_INSTANCE_PREFIX)){
+ }else if(target.startsWith(ClusterConfig.EC2_INSTANCE_PREFIX)){
DescribeInstancesResult ir = cluster.getInstanceForId(target);
- if(ir.getReservations().size() > 0)
- if(ir.getReservations().get(0).getInstances().size() > 0)
+ LOG.info(ir.toString());
+ if(ir.getReservations().size() > 0){
+ if(ir.getReservations().get(0).getInstances().size() > 0){
host = ir.getReservations().get(0).getInstances().get(0).getPublicDnsName();
+ }
+ }
}
if(host == null){
System.out.println("'" + target + "' is not a valid cluster name or instance id.\nexiting.");

0 comments on commit 00d657b

Please sign in to comment.