mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Forward merge branch '4.11' (PR: #2576) to master
This commit is contained in:
commit
15afc35ff9
@ -1052,5 +1052,6 @@ def main(argv):
|
|||||||
red.set()
|
red.set()
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main(sys.argv)
|
main(sys.argv)
|
||||||
|
|||||||
@ -42,10 +42,10 @@ class CsProcess(object):
|
|||||||
self.pid = []
|
self.pid = []
|
||||||
for i in CsHelper.execute("ps aux"):
|
for i in CsHelper.execute("ps aux"):
|
||||||
items = len(self.search)
|
items = len(self.search)
|
||||||
proc = re.split("\s+", i)[items*-1:]
|
proc = re.split(r"\s+", i)[items*-1:]
|
||||||
matches = len([m for m in proc if m in self.search])
|
matches = len([m for m in proc if m in self.search])
|
||||||
if matches == items:
|
if matches == items:
|
||||||
self.pid.append(re.split("\s+", i)[1])
|
self.pid.append(re.split(r"\s+", i)[1])
|
||||||
|
|
||||||
logging.debug("CsProcess:: Searching for process ==> %s and found PIDs ==> %s", self.search, self.pid)
|
logging.debug("CsProcess:: Searching for process ==> %s and found PIDs ==> %s", self.search, self.pid)
|
||||||
return self.pid
|
return self.pid
|
||||||
@ -61,5 +61,5 @@ class CsProcess(object):
|
|||||||
def grep(self, str):
|
def grep(self, str):
|
||||||
for i in CsHelper.execute("ps aux"):
|
for i in CsHelper.execute("ps aux"):
|
||||||
if i.find(str) != -1:
|
if i.find(str) != -1:
|
||||||
return re.split("\s+", i)[1]
|
return re.split(r"\s+", i)[1]
|
||||||
return -1
|
return -1
|
||||||
|
|||||||
@ -127,7 +127,7 @@ class CsRedundant(object):
|
|||||||
"%s/%s" % (self.CS_TEMPLATES_DIR, "checkrouter.sh.templ"), "/opt/cloud/bin/checkrouter.sh")
|
"%s/%s" % (self.CS_TEMPLATES_DIR, "checkrouter.sh.templ"), "/opt/cloud/bin/checkrouter.sh")
|
||||||
|
|
||||||
CsHelper.execute(
|
CsHelper.execute(
|
||||||
'sed -i "s/--exec\ \$DAEMON;/--exec\ \$DAEMON\ --\ --vrrp;/g" /etc/init.d/keepalived')
|
'sed -i "s/--exec $DAEMON;/--exec $DAEMON -- --vrrp;/g" /etc/init.d/keepalived')
|
||||||
# checkrouter.sh configuration
|
# checkrouter.sh configuration
|
||||||
check_router = CsFile("/opt/cloud/bin/checkrouter.sh")
|
check_router = CsFile("/opt/cloud/bin/checkrouter.sh")
|
||||||
check_router.greplace("[RROUTER_LOG]", self.RROUTER_LOG)
|
check_router.greplace("[RROUTER_LOG]", self.RROUTER_LOG)
|
||||||
@ -319,7 +319,7 @@ class CsRedundant(object):
|
|||||||
logging.info("Adding gateway ==> %s to device ==> %s" % (gateway, dev))
|
logging.info("Adding gateway ==> %s to device ==> %s" % (gateway, dev))
|
||||||
if dev == CsHelper.PUBLIC_INTERFACES[self.cl.get_type()]:
|
if dev == CsHelper.PUBLIC_INTERFACES[self.cl.get_type()]:
|
||||||
route.add_defaultroute(gateway)
|
route.add_defaultroute(gateway)
|
||||||
except:
|
except Exception:
|
||||||
logging.error("ERROR getting gateway from device %s" % dev)
|
logging.error("ERROR getting gateway from device %s" % dev)
|
||||||
else:
|
else:
|
||||||
logging.error("Device %s was not ready could not bring it up" % dev)
|
logging.error("Device %s was not ready could not bring it up" % dev)
|
||||||
|
|||||||
@ -193,6 +193,7 @@ class LineEditingFile(object):
|
|||||||
os.unlink(changed_filename)
|
os.unlink(changed_filename)
|
||||||
return changes
|
return changes
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
logging.basicConfig(level=logging.DEBUG)
|
logging.basicConfig(level=logging.DEBUG)
|
||||||
import doctest
|
import doctest
|
||||||
|
|||||||
@ -112,6 +112,7 @@ def is_guestnet_configured(guestnet_dict, keys):
|
|||||||
|
|
||||||
return exists
|
return exists
|
||||||
|
|
||||||
|
|
||||||
# If the command line json file is unprocessed process it
|
# If the command line json file is unprocessed process it
|
||||||
# This is important or, the control interfaces will get deleted!
|
# This is important or, the control interfaces will get deleted!
|
||||||
if jsonFilename != "cmd_line.json" and os.path.isfile(jsonPath % "cmd_line.json"):
|
if jsonFilename != "cmd_line.json" and os.path.isfile(jsonPath % "cmd_line.json"):
|
||||||
|
|||||||
@ -164,5 +164,6 @@ def unflock(file):
|
|||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main(sys.argv[1:])
|
main(sys.argv[1:])
|
||||||
|
|||||||
@ -38,5 +38,6 @@ class TestCsAddress(unittest.TestCase):
|
|||||||
def test_get_guest_netmask(self):
|
def test_get_guest_netmask(self):
|
||||||
self.assertTrue(self.csaddress.get_guest_netmask() == "255.255.255.0")
|
self.assertTrue(self.csaddress.get_guest_netmask() == "255.255.255.0")
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|||||||
@ -34,5 +34,6 @@ class TestCsApp(unittest.TestCase):
|
|||||||
csapp = CsApp(csip)
|
csapp = CsApp(csip)
|
||||||
self.assertTrue(csapp is not None)
|
self.assertTrue(csapp is not None)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|||||||
@ -42,5 +42,6 @@ class TestCsCmdLine(unittest.TestCase):
|
|||||||
self.cscmdline.set_guest_gw(tval)
|
self.cscmdline.set_guest_gw(tval)
|
||||||
self.assertTrue(self.cscmdline.get_guest_gw() == tval)
|
self.assertTrue(self.cscmdline.get_guest_gw() == tval)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|||||||
@ -29,5 +29,6 @@ class TestCsConfig(unittest.TestCase):
|
|||||||
csconfig = CsConfig()
|
csconfig = CsConfig()
|
||||||
self.assertTrue(csconfig is not None)
|
self.assertTrue(csconfig is not None)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|||||||
@ -29,5 +29,6 @@ class TestCsDatabag(unittest.TestCase):
|
|||||||
csdatabag = CsDataBag("koffie")
|
csdatabag = CsDataBag("koffie")
|
||||||
self.assertTrue(csdatabag is not None)
|
self.assertTrue(csdatabag is not None)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|||||||
@ -33,5 +33,6 @@ class TestCsDhcp(unittest.TestCase):
|
|||||||
csdhcp = CsDhcp("dhcpentry", {})
|
csdhcp = CsDhcp("dhcpentry", {})
|
||||||
self.assertTrue(csdhcp is not None)
|
self.assertTrue(csdhcp is not None)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|||||||
@ -29,5 +29,6 @@ class TestCsFile(unittest.TestCase):
|
|||||||
csfile = CsFile("testfile")
|
csfile = CsFile("testfile")
|
||||||
self.assertTrue(csfile is not None)
|
self.assertTrue(csfile is not None)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|||||||
@ -41,5 +41,6 @@ class TestCsGuestNetwork(unittest.TestCase):
|
|||||||
dns = csguestnetwork.get_dns()
|
dns = csguestnetwork.get_dns()
|
||||||
self.assertTrue(len(dns) == 2)
|
self.assertTrue(len(dns) == 2)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|||||||
@ -31,5 +31,6 @@ class TestCsHelper(unittest.TestCase):
|
|||||||
result = CsHelper.execute("/bin/false")
|
result = CsHelper.execute("/bin/false")
|
||||||
self.assertTrue(result is not None)
|
self.assertTrue(result is not None)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|||||||
@ -34,5 +34,6 @@ class TestCsInterface(unittest.TestCase):
|
|||||||
def test_is_public(self):
|
def test_is_public(self):
|
||||||
self.assertTrue(self.csinterface.is_public() is False)
|
self.assertTrue(self.csinterface.is_public() is False)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|||||||
@ -29,5 +29,6 @@ class TestCsNetfilter(unittest.TestCase):
|
|||||||
csnetfilter = CsNetfilter()
|
csnetfilter = CsNetfilter()
|
||||||
self.assertTrue(csnetfilter is not None)
|
self.assertTrue(csnetfilter is not None)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|||||||
@ -29,5 +29,6 @@ class TestCsProcess(unittest.TestCase):
|
|||||||
csprocess = CsProcess({})
|
csprocess = CsProcess({})
|
||||||
self.assertTrue(csprocess is not None)
|
self.assertTrue(csprocess is not None)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|||||||
@ -36,5 +36,6 @@ class TestCsRedundant(unittest.TestCase):
|
|||||||
csredundant = CsRedundant(csconfig)
|
csredundant = CsRedundant(csconfig)
|
||||||
self.assertTrue(csredundant is not None)
|
self.assertTrue(csredundant is not None)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|||||||
@ -43,5 +43,6 @@ class TestCsRoute(unittest.TestCase):
|
|||||||
name = "eth1"
|
name = "eth1"
|
||||||
self.assertEqual("Table_eth1", csroute.get_tablename(name))
|
self.assertEqual("Table_eth1", csroute.get_tablename(name))
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|||||||
@ -29,5 +29,6 @@ class TestCsRule(unittest.TestCase):
|
|||||||
csrule = CsRule("eth1")
|
csrule = CsRule("eth1")
|
||||||
self.assertTrue(csrule is not None)
|
self.assertTrue(csrule is not None)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|||||||
@ -21,9 +21,9 @@
|
|||||||
export PYTHONPATH="../debian/opt/cloud/bin/"
|
export PYTHONPATH="../debian/opt/cloud/bin/"
|
||||||
export PYTHONDONTWRITEBYTECODE=False
|
export PYTHONDONTWRITEBYTECODE=False
|
||||||
|
|
||||||
echo "Running pep8 to check systemvm/python code for errors"
|
echo "Running pycodestyle to check systemvm/python code for errors"
|
||||||
pep8 --max-line-length=179 *py
|
pycodestyle --max-line-length=179 *py
|
||||||
pep8 --max-line-length=179 --exclude=monitorServices.py,baremetal-vr.py,passwd_server_ip.py `find ../debian -name \*.py`
|
pycodestyle --max-line-length=179 --exclude=monitorServices.py,baremetal-vr.py,passwd_server_ip.py `find ../debian -name \*.py`
|
||||||
if [ $? -gt 0 ]
|
if [ $? -gt 0 ]
|
||||||
then
|
then
|
||||||
echo "Pylint failed, please check your code"
|
echo "Pylint failed, please check your code"
|
||||||
|
|||||||
@ -22,6 +22,8 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
echo -e "#### System Information ####"
|
echo -e "#### System Information ####"
|
||||||
|
echo -e "\nO.S. information:"
|
||||||
|
echo $(uname -a)
|
||||||
|
|
||||||
echo -e "\nWho am I:"
|
echo -e "\nWho am I:"
|
||||||
whoami
|
whoami
|
||||||
@ -100,7 +102,7 @@ pip install --user --upgrade pip
|
|||||||
|
|
||||||
for ((i=0;i<$RETRY_COUNT;i++))
|
for ((i=0;i<$RETRY_COUNT;i++))
|
||||||
do
|
do
|
||||||
pip install --user --upgrade lxml paramiko nose texttable ipmisim pyopenssl mock flask netaddr pylint pep8 > /tmp/piplog
|
pip install --user --upgrade lxml paramiko nose texttable ipmisim pyopenssl mock flask netaddr pylint pycodestyle six astroid > /tmp/piplog
|
||||||
if [[ $? -eq 0 ]]; then
|
if [[ $? -eq 0 ]]; then
|
||||||
echo -e "\npython packages installed successfully"
|
echo -e "\npython packages installed successfully"
|
||||||
break;
|
break;
|
||||||
@ -109,3 +111,5 @@ do
|
|||||||
cat /tmp/piplog
|
cat /tmp/piplog
|
||||||
done
|
done
|
||||||
|
|
||||||
|
echo -e "\nVersion of pip packages:\n"
|
||||||
|
echo $(pip freeze)
|
||||||
Loading…
x
Reference in New Issue
Block a user