mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Merge remote-tracking branch 'origin/4.9' into 4.10
This commit is contained in:
commit
ffddd6db09
@ -208,6 +208,12 @@ public class ClusterResponse extends BaseResponse {
|
|||||||
if (details == null) {
|
if (details == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.resourceDetails = new HashMap<>(details);
|
resourceDetails = new HashMap<>(details);
|
||||||
|
if (resourceDetails.containsKey("username")) {
|
||||||
|
resourceDetails.remove("username");
|
||||||
|
}
|
||||||
|
if (resourceDetails.containsKey("password")) {
|
||||||
|
resourceDetails.remove("password");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -435,10 +435,8 @@ if [ "$1" == "2" ] ; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
%post management
|
%post management
|
||||||
if [ "$1" == "1" ] ; then
|
/sbin/chkconfig --add cloudstack-management > /dev/null 2>&1 || true
|
||||||
/sbin/chkconfig --add cloudstack-management > /dev/null 2>&1 || true
|
/sbin/chkconfig --level 345 cloudstack-management on > /dev/null 2>&1 || true
|
||||||
/sbin/chkconfig --level 345 cloudstack-management on > /dev/null 2>&1 || true
|
|
||||||
fi
|
|
||||||
|
|
||||||
grep -s -q "db.cloud.driver=jdbc:mysql" "%{_sysconfdir}/%{name}/management/db.properties" || sed -i -e "\$adb.cloud.driver=jdbc:mysql" "%{_sysconfdir}/%{name}/management/db.properties"
|
grep -s -q "db.cloud.driver=jdbc:mysql" "%{_sysconfdir}/%{name}/management/db.properties" || sed -i -e "\$adb.cloud.driver=jdbc:mysql" "%{_sysconfdir}/%{name}/management/db.properties"
|
||||||
grep -s -q "db.usage.driver=jdbc:mysql" "%{_sysconfdir}/%{name}/management/db.properties" || sed -i -e "\$adb.usage.driver=jdbc:mysql" "%{_sysconfdir}/%{name}/management/db.properties"
|
grep -s -q "db.usage.driver=jdbc:mysql" "%{_sysconfdir}/%{name}/management/db.properties" || sed -i -e "\$adb.usage.driver=jdbc:mysql" "%{_sysconfdir}/%{name}/management/db.properties"
|
||||||
@ -523,18 +521,19 @@ if [ -d "%{_sysconfdir}/cloud" ] ; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
%post agent
|
%post agent
|
||||||
if [ "$1" == "1" ] ; then
|
if [ "$1" == "2" ] ; then
|
||||||
echo "Running %{_bindir}/%{name}-agent-upgrade to update bridge name for upgrade from CloudStack 4.0.x (and before) to CloudStack 4.1 (and later)"
|
echo "Running %{_bindir}/%{name}-agent-upgrade to update bridge name for upgrade from CloudStack 4.0.x (and before) to CloudStack 4.1 (and later)"
|
||||||
%{_bindir}/%{name}-agent-upgrade
|
%{_bindir}/%{name}-agent-upgrade
|
||||||
if [ ! -d %{_sysconfdir}/libvirt/hooks ] ; then
|
|
||||||
mkdir %{_sysconfdir}/libvirt/hooks
|
|
||||||
fi
|
|
||||||
cp -a ${RPM_BUILD_ROOT}%{_datadir}/%{name}-agent/lib/libvirtqemuhook %{_sysconfdir}/libvirt/hooks/qemu
|
|
||||||
/sbin/service libvirtd restart
|
|
||||||
/sbin/chkconfig --add cloudstack-agent > /dev/null 2>&1 || true
|
|
||||||
/sbin/chkconfig --level 345 cloudstack-agent on > /dev/null 2>&1 || true
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ ! -d %{_sysconfdir}/libvirt/hooks ] ; then
|
||||||
|
mkdir %{_sysconfdir}/libvirt/hooks
|
||||||
|
fi
|
||||||
|
cp -a ${RPM_BUILD_ROOT}%{_datadir}/%{name}-agent/lib/libvirtqemuhook %{_sysconfdir}/libvirt/hooks/qemu
|
||||||
|
/sbin/service libvirtd restart
|
||||||
|
/sbin/chkconfig --add cloudstack-agent > /dev/null 2>&1 || true
|
||||||
|
/sbin/chkconfig --level 345 cloudstack-agent on > /dev/null 2>&1 || true
|
||||||
|
|
||||||
# if saved configs from upgrade exist, copy them over
|
# if saved configs from upgrade exist, copy them over
|
||||||
if [ -f "%{_sysconfdir}/cloud.rpmsave/agent/agent.properties" ]; then
|
if [ -f "%{_sysconfdir}/cloud.rpmsave/agent/agent.properties" ]; then
|
||||||
mv %{_sysconfdir}/%{name}/agent/agent.properties %{_sysconfdir}/%{name}/agent/agent.properties.rpmnew
|
mv %{_sysconfdir}/%{name}/agent/agent.properties %{_sysconfdir}/%{name}/agent/agent.properties.rpmnew
|
||||||
|
|||||||
@ -393,9 +393,7 @@ if [ "$1" == "2" ] ; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
%post management
|
%post management
|
||||||
if [ "$1" == "1" ] ; then
|
/usr/bin/systemctl on cloudstack-management > /dev/null 2>&1 || true
|
||||||
/usr/bin/systemctl on cloudstack-management > /dev/null 2>&1 || true
|
|
||||||
fi
|
|
||||||
|
|
||||||
grep -s -q "db.cloud.driver=jdbc:mysql" "%{_sysconfdir}/%{name}/management/db.properties" || sed -i -e "\$adb.cloud.driver=jdbc:mysql" "%{_sysconfdir}/%{name}/management/db.properties"
|
grep -s -q "db.cloud.driver=jdbc:mysql" "%{_sysconfdir}/%{name}/management/db.properties" || sed -i -e "\$adb.cloud.driver=jdbc:mysql" "%{_sysconfdir}/%{name}/management/db.properties"
|
||||||
grep -s -q "db.usage.driver=jdbc:mysql" "%{_sysconfdir}/%{name}/management/db.properties" || sed -i -e "\$adb.usage.driver=jdbc:mysql" "%{_sysconfdir}/%{name}/management/db.properties"
|
grep -s -q "db.usage.driver=jdbc:mysql" "%{_sysconfdir}/%{name}/management/db.properties" || sed -i -e "\$adb.usage.driver=jdbc:mysql" "%{_sysconfdir}/%{name}/management/db.properties"
|
||||||
@ -425,16 +423,16 @@ if [ -d "%{_sysconfdir}/cloud" ] ; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
%post agent
|
%post agent
|
||||||
if [ "$1" == "1" ] ; then
|
if [ "$1" == "2" ] ; then
|
||||||
echo "Running %{_bindir}/%{name}-agent-upgrade to update bridge name for upgrade from CloudStack 4.0.x (and before) to CloudStack 4.1 (and later)"
|
echo "Running %{_bindir}/%{name}-agent-upgrade to update bridge name for upgrade from CloudStack 4.0.x (and before) to CloudStack 4.1 (and later)"
|
||||||
%{_bindir}/%{name}-agent-upgrade
|
%{_bindir}/%{name}-agent-upgrade
|
||||||
if [ ! -d %{_sysconfdir}/libvirt/hooks ] ; then
|
|
||||||
mkdir %{_sysconfdir}/libvirt/hooks
|
|
||||||
fi
|
|
||||||
cp -a ${RPM_BUILD_ROOT}%{_datadir}/%{name}-agent/lib/libvirtqemuhook %{_sysconfdir}/libvirt/hooks/qemu
|
|
||||||
/sbin/service libvirtd restart
|
|
||||||
/sbin/systemctl enable cloudstack-agent > /dev/null 2>&1 || true
|
|
||||||
fi
|
fi
|
||||||
|
if [ ! -d %{_sysconfdir}/libvirt/hooks ] ; then
|
||||||
|
mkdir %{_sysconfdir}/libvirt/hooks
|
||||||
|
fi
|
||||||
|
cp -a ${RPM_BUILD_ROOT}%{_datadir}/%{name}-agent/lib/libvirtqemuhook %{_sysconfdir}/libvirt/hooks/qemu
|
||||||
|
/sbin/service libvirtd restart
|
||||||
|
/sbin/systemctl enable cloudstack-agent > /dev/null 2>&1 || true
|
||||||
|
|
||||||
# if saved configs from upgrade exist, copy them over
|
# if saved configs from upgrade exist, copy them over
|
||||||
if [ -f "%{_sysconfdir}/cloud.rpmsave/agent/agent.properties" ]; then
|
if [ -f "%{_sysconfdir}/cloud.rpmsave/agent/agent.properties" ]; then
|
||||||
|
|||||||
@ -150,7 +150,7 @@ class CsAcl(CsDataBag):
|
|||||||
" -A FIREWALL_%s" % self.ip +
|
" -A FIREWALL_%s" % self.ip +
|
||||||
" -s %s " % cidr +
|
" -s %s " % cidr +
|
||||||
" -p %s " % rule['protocol'] +
|
" -p %s " % rule['protocol'] +
|
||||||
" %s -j RETURN" % rnge])
|
" %s -j %s" % (rnge, self.rule['action'])])
|
||||||
|
|
||||||
sflag=False
|
sflag=False
|
||||||
dflag=False
|
dflag=False
|
||||||
|
|||||||
@ -384,7 +384,7 @@ class CsIP:
|
|||||||
self.fw.append(["mangle", "",
|
self.fw.append(["mangle", "",
|
||||||
"-A FIREWALL_%s -j DROP" % self.address['public_ip']])
|
"-A FIREWALL_%s -j DROP" % self.address['public_ip']])
|
||||||
self.fw.append(["mangle", "",
|
self.fw.append(["mangle", "",
|
||||||
"-A VPN_%s -m state --state RELATED,ESTABLISHED -j ACCEPT" % self.address['public_ip']])
|
"-I VPN_%s -m state --state RELATED,ESTABLISHED -j ACCEPT" % self.address['public_ip']])
|
||||||
self.fw.append(["mangle", "",
|
self.fw.append(["mangle", "",
|
||||||
"-A VPN_%s -j RETURN" % self.address['public_ip']])
|
"-A VPN_%s -j RETURN" % self.address['public_ip']])
|
||||||
self.fw.append(["nat", "",
|
self.fw.append(["nat", "",
|
||||||
|
|||||||
@ -63,7 +63,7 @@ class CsRoute:
|
|||||||
table = self.get_tablename(dev)
|
table = self.get_tablename(dev)
|
||||||
logging.info("Adding route: dev " + dev + " table: " +
|
logging.info("Adding route: dev " + dev + " table: " +
|
||||||
table + " network: " + address + " if not present")
|
table + " network: " + address + " if not present")
|
||||||
cmd = "dev %s table %s %s" % (dev, table, address)
|
cmd = "dev %s table %s throw %s proto static" % (dev, table, address)
|
||||||
self.set_route(cmd)
|
self.set_route(cmd)
|
||||||
|
|
||||||
def set_route(self, cmd, method="add"):
|
def set_route(self, cmd, method="add"):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user