You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by re...@apache.org on 2016/01/20 14:18:37 UTC

[06/10] git commit: updated refs/heads/master to 6f9215c

Refactor public ip retrieval into method


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

Branch: refs/heads/master
Commit: 91f7fc05b650c51efa9a15bf04881b3ae2d6d34f
Parents: d601570
Author: Daan Hoogland <da...@onecht.net>
Authored: Tue Jan 19 23:02:26 2016 +0100
Committer: Remi Bergsma <gi...@remi.nl>
Committed: Tue Jan 19 23:02:26 2016 +0100

----------------------------------------------------------------------
 .../debian/config/etc/init.d/cloud-early-config     | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/91f7fc05/systemvm/patches/debian/config/etc/init.d/cloud-early-config
----------------------------------------------------------------------
diff --git a/systemvm/patches/debian/config/etc/init.d/cloud-early-config b/systemvm/patches/debian/config/etc/init.d/cloud-early-config
index 59e73a2..5d45661 100755
--- a/systemvm/patches/debian/config/etc/init.d/cloud-early-config
+++ b/systemvm/patches/debian/config/etc/init.d/cloud-early-config
@@ -1166,9 +1166,7 @@ setup_storage_network() {
 }
 
 setup_system_rfc1918_internal() {
-  public_ip=$ETH2_IP
-  [ "$ETH2_IP" == "0.0.0.0" ] && public_ip=$ETH1_IP
-
+  public_ip=`getPublicIp`
   echo "$public_ip" | grep -E "^((127\.)|(10\.)|(172\.1[6-9]\.)|(172\.2[0-9]\.)|(172\.3[0-1]\.)|(192\.168\.))"
   if [ "$?" == "0" ]; then
      log_it "Not setting up route of RFC1918 space to $LOCAL_GW befause $public_ip is RFC1918."
@@ -1183,6 +1181,12 @@ setup_system_rfc1918_internal() {
   fi
 }
 
+getPublicIp() {
+  public_ip=$ETH2_IP
+  [ "$ETH2_IP" == "0.0.0.0" ] && public_ip=$ETH1_IP
+  echo $public_ip
+}
+
 setup_secstorage() {
   log_it "Setting up secondary storage system vm"
   sysctl vm.min_free_kbytes=8192
@@ -1191,8 +1195,7 @@ setup_secstorage() {
   setup_storage_network
   setup_system_rfc1918_internal
   sed -i  /gateway/d /etc/hosts
-  public_ip=$ETH2_IP
-  [ "$ETH2_IP" == "0.0.0.0" ] && public_ip=$ETH1_IP
+  public_ip=`getPublicIp`
   echo "$public_ip $NAME" >> /etc/hosts
 
   cp /etc/iptables/iptables-secstorage /etc/iptables/rules.v4
@@ -1249,8 +1252,7 @@ setup_console_proxy() {
   local hyp=$1
   setup_common eth0 eth1 eth2
   setup_system_rfc1918_internal
-  public_ip=$ETH2_IP
-  [ "$ETH2_IP" == "0.0.0.0" ] && public_ip=$ETH1_IP
+  public_ip=`getPublicIp`
   sed -i  /gateway/d /etc/hosts
   echo "$public_ip $NAME" >> /etc/hosts
   cp /etc/iptables/iptables-consoleproxy /etc/iptables/rules.v4