cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhais...@apache.org
Subject git commit: updated refs/heads/master to 83736ab
Date Tue, 17 Mar 2015 08:53:16 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/master e3c04c714 -> 83736ab53


CLOUDSTACK-8331: savepassword should try all IPs on eth0

The logic is same as passwd_server_ip script which runs password server on all
IPs on eth0 interface.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
(cherry picked from commit 294503a0251a1305c61a83bf4a094c1af8030a4c)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>


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

Branch: refs/heads/master
Commit: 83736ab534f54aa20899021fd86cfbac3c203ce9
Parents: e3c04c7
Author: Rohit Yadav <rohit.yadav@shapeblue.com>
Authored: Tue Mar 17 14:21:48 2015 +0530
Committer: Rohit Yadav <rohit.yadav@shapeblue.com>
Committed: Tue Mar 17 14:23:07 2015 +0530

----------------------------------------------------------------------
 .../patches/debian/config/opt/cloud/bin/passwd_server_ip.py   | 5 +++--
 systemvm/patches/debian/config/opt/cloud/bin/savepassword.sh  | 7 +++++--
 2 files changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/83736ab5/systemvm/patches/debian/config/opt/cloud/bin/passwd_server_ip.py
----------------------------------------------------------------------
diff --git a/systemvm/patches/debian/config/opt/cloud/bin/passwd_server_ip.py b/systemvm/patches/debian/config/opt/cloud/bin/passwd_server_ip.py
index 097d4fb..7476666 100755
--- a/systemvm/patches/debian/config/opt/cloud/bin/passwd_server_ip.py
+++ b/systemvm/patches/debian/config/opt/cloud/bin/passwd_server_ip.py
@@ -39,6 +39,7 @@ from SocketServer     import ThreadingMixIn #, ForkingMixIn
 
 passMap = {}
 secureToken = None
+listeningAddress = '127.0.0.1'
 lock = threading.RLock()
 
 def getTokenFile():
@@ -133,7 +134,7 @@ class PasswordRequestHandler(BaseHTTPRequestHandler):
         self.send_response(200)
         self.end_headers()
         clientAddress = self.client_address[0]
-        if clientAddress not in ['localhost', '127.0.0.1']:
+        if clientAddress not in ['localhost', '127.0.0.1', listeningAddress]:
             syslog.syslog('serve_password: non-localhost IP trying to save password: %s'
% clientAddress)
             self.send_response(403)
             return
@@ -162,7 +163,7 @@ class PasswordRequestHandler(BaseHTTPRequestHandler):
 def serve(HandlerClass = PasswordRequestHandler,
           ServerClass = ThreadedHTTPServer):
 
-    listeningAddress = '127.0.0.1'
+    global listeningAddress
     if len(sys.argv) > 1:
         listeningAddress = sys.argv[1]
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/83736ab5/systemvm/patches/debian/config/opt/cloud/bin/savepassword.sh
----------------------------------------------------------------------
diff --git a/systemvm/patches/debian/config/opt/cloud/bin/savepassword.sh b/systemvm/patches/debian/config/opt/cloud/bin/savepassword.sh
index 4a870fb..7fdc99f 100755
--- a/systemvm/patches/debian/config/opt/cloud/bin/savepassword.sh
+++ b/systemvm/patches/debian/config/opt/cloud/bin/savepassword.sh
@@ -30,7 +30,6 @@ do
         ;;
   esac
 done
-SERVER_IP=$(/sbin/ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}')
 TOKEN_FILE="/tmp/passwdsrvrtoken"
 TOKEN=""
 if [ -f $TOKEN_FILE ]; then
@@ -39,5 +38,9 @@ fi
 ps aux | grep passwd_server_ip.py |grep -v grep 2>&1 > /dev/null
 if [ $? -eq 0 ]
 then
-    curl --header "DomU_Request: save_password" "http://$SERVER_IP:8080/" -F "ip=$VM_IP"
-F "password=$PASSWORD" -F "token=$TOKEN"
+    ips=$(ip addr show dev eth0 | grep inet | grep eth0 | awk '{print $2}')
+    for ip in $ips; do
+        server_ip=$(echo $ip | awk -F'/' '{print $1}')
+        curl --header "DomU_Request: save_password" "http://$server_ip:8080/" -F "ip=$VM_IP"
-F "password=$PASSWORD" -F "token=$TOKEN" >/dev/null 2>/dev/null &
+    done
 fi


Mime
View raw message