You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by mc...@apache.org on 2014/01/22 20:27:40 UTC

[15/53] [abbrv] git commit: updated refs/heads/rbac to 33cd1ab

CLOUDSTACK-5779: Clean up savepassword scripts


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

Branch: refs/heads/rbac
Commit: ca81e7b465fb40866fd14d1d1d27a2c42e1a2741
Parents: 0ea1c7d
Author: Sheng Yang <sh...@citrix.com>
Authored: Fri Jan 17 11:51:42 2014 -0800
Committer: Sheng Yang <sh...@citrix.com>
Committed: Fri Jan 17 12:36:42 2014 -0800

----------------------------------------------------------------------
 .../virtualnetwork/VirtualRoutingResource.java  |  2 -
 scripts/network/domr/save_password_to_domr.sh   | 73 --------------------
 2 files changed, 75 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ca81e7b4/core/src/com/cloud/agent/resource/virtualnetwork/VirtualRoutingResource.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/agent/resource/virtualnetwork/VirtualRoutingResource.java b/core/src/com/cloud/agent/resource/virtualnetwork/VirtualRoutingResource.java
index c66b9cb..ff99b92 100755
--- a/core/src/com/cloud/agent/resource/virtualnetwork/VirtualRoutingResource.java
+++ b/core/src/com/cloud/agent/resource/virtualnetwork/VirtualRoutingResource.java
@@ -537,9 +537,7 @@ public class VirtualRoutingResource implements Manager {
     protected Answer execute(final SavePasswordCommand cmd) {
         final String password = cmd.getPassword();
         final String routerPrivateIPAddress = cmd.getAccessDetail(NetworkElementCommand.ROUTER_IP);
-        final String vmName = cmd.getVmName();
         final String vmIpAddress = cmd.getVmIpAddress();
-        final String local = vmName;
 
         String args = "-v " + vmIpAddress;
         args += " -p " + password;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ca81e7b4/scripts/network/domr/save_password_to_domr.sh
----------------------------------------------------------------------
diff --git a/scripts/network/domr/save_password_to_domr.sh b/scripts/network/domr/save_password_to_domr.sh
deleted file mode 100755
index 9b44663..0000000
--- a/scripts/network/domr/save_password_to_domr.sh
+++ /dev/null
@@ -1,73 +0,0 @@
-#!/bin/bash
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-# 
-#   http://www.apache.org/licenses/LICENSE-2.0
-# 
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-
-# $Id: save_password_to_domr.sh 9804 2010-06-22 18:36:49Z alex $ $HeadURL: svn://svn.lab.vmops.com/repos/vmdev/java/scripts/network/domr/save_password_to_domr.sh $
-# @VERSION@
-
-PASSWD_FILE=/var/cache/cloud/passwords
-
-#   $1 filename
-#   $2 keyname
-#   $3 value
-replace_in_file_on_domr() {
-  local filename=$1
-  local keyname=$2
-  local value=$3
-  $VIA_SSH "sed -i /$keyname=/d $filename; \
-  		 	echo "$keyname=$value" >> $filename "
-  		 	
-  # $VIA_SSH "sed -e /$keyname/d $filename > $filename.new; \
-  #        mv $filename.new $filename;\
-  #         echo "$keyname=$value" >> $filename "
-  
-  return $?
-}
-
-cert="/root/.ssh/id_rsa.cloud"
-
-while getopts 'r:v:p:' OPTION
-do
-  case $OPTION in
-  r)	
-		DOMR_IP="$OPTARG"
-		;;
-  v)	VM_IP="$OPTARG"
-		;;
-  p)	
-		ENCODEDPASSWORD="$OPTARG"
-		PASSWORD=$(echo $ENCODEDPASSWORD | tr '[a-m][n-z][A-M][N-Z]' '[n-z][a-m][N-Z][A-M]')
-		;;
-  ?)	echo "Incorrect usage"
-		exit 1
-		;;
-  esac
-done
-
-VIA_SSH="ssh -p 3922 -o StrictHostKeyChecking=no -i $cert root@$DOMR_IP"
-
-$VIA_SSH "if [ ! -f $PASSWD_FILE ]; then touch $PASSWD_FILE; fi;"
-
-replace_in_file_on_domr $PASSWD_FILE $VM_IP $PASSWORD
-
-if [ $? -ne 0 ]
-then
-	exit 1
-fi
-
-exit 0