CLOUDSTACK-7213: fixed continuing cloud-setup-database if there is no selinux

This commit is contained in:
Jayapal 2014-07-16 10:45:03 +05:30
parent 3d6c64d262
commit 79fcbd4a59
2 changed files with 10 additions and 2 deletions

View File

@ -314,6 +314,7 @@ def check_cgroups():
def check_selinux():
if distro not in [Fedora,CentOS,RHEL6]: return # no selinux outside of those
enforcing = False
config_enforcing = False
try:
output = getenforce().stdout.strip()
if "nforcing" in output:

View File

@ -167,6 +167,10 @@ Sql parameters:
'''%(table, e.__str__(), kwargs)
self.errorAndExit(err)
def errorAndContinue(self, msg):
sys.stderr.write(msg)
sys.stderr.flush()
def errorAndExit(self, msg):
self.postRun()
err = '''\n\nWe apologize for below error:
@ -389,10 +393,13 @@ for example:
try:
check_selinux()
except CheckFailed, e:
self.errorAndExit(e.__str__())
self.info("checkSelinux failed with error continuing...", None)
self.errorAndContinue(e.__str__())
except OSError, e:
if e.errno == 2: pass
else: self.errorAndExit(e.__str__())
else:
self.info("checkSelinux failed with error continuing...", None)
self.errorAndContinue(e.__str__())
self.info(None, True)
checkCloudDbFiles()