diff options
Diffstat (limited to 'abs/core-testing/LinHES-config/mv_misc.py')
-rwxr-xr-x[-rw-r--r--] | abs/core-testing/LinHES-config/mv_misc.py | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/abs/core-testing/LinHES-config/mv_misc.py b/abs/core-testing/LinHES-config/mv_misc.py index eba7b57..27aeb98 100644..100755 --- a/abs/core-testing/LinHES-config/mv_misc.py +++ b/abs/core-testing/LinHES-config/mv_misc.py @@ -25,13 +25,13 @@ def setup_zip(MVROOT,zipcode): logging.debug("__End of zipcode\n") def setup_tz(timezone,TEMPLATES): - logging.debug("____Setting up the timezone____") + logging.info("____Setting up the timezone____") if not timezone: timezone="unknown" - logging.debug(" Setting timezone to %s",timezone) + logging.info(" Setting timezone to %s",timezone) try: - logging.debug(" Removeing /etc/localtime") + logging.debug(" Removing /etc/localtime") os.remove("/etc/localtime") except: logging.debug(" Couldn't remove /etc/localtime") @@ -39,17 +39,20 @@ def setup_tz(timezone,TEMPLATES): srclink="/usr/share/zoneinfo/%s" %timezone logging.debug(" symlinking %s to /etc/localtime",srclink) - os.symlink(srclink,"/etc/localtime") - cmd = '''sed -e "s~^TIMEZONE=.*$~TIMEZONE=\"%s\"~" /etc/rc.conf > $TEMPLATES/rc.conf''' %timezone + try: + os.symlink(srclink,"/etc/localtime") + except: + logging.critical(" Couldn't make symlink for /etc/localtime") + cmd = '''sed -e "s/^TIMEZONE=.*$/TIMEZONE=\\"%s\\" /" /etc/rc.conf > $TEMPLATES/rc.conf''' %re.escape(timezone) mv_common.runcmd(cmd) if os.path.exists("/etc/php/php.ini"): - logging.debug("Changing timezone for php") - cmd = '''sed -i "s/^.*date.timezone.*$/date.timezone=%s/" ${BASE}/etc/php/php.ini''' %timezone + logging.info(" Changing timezone for php") + cmd = '''sed -i "s/^.*date.timezone.*$/date.timezone=%s/" ${BASE}/etc/php/php.ini''' %re.escape(timezone) mv_common.runcmd(cmd) mv_common.cp_and_log(TEMPLATES+"/rc.conf","/etc/rc.conf") - logging.debug("__End of timezone\n") + logging.info("__End of timezone\n") def setup_nfs(systemconfig): nfslist=[] @@ -72,11 +75,10 @@ def setup_nfs(systemconfig): nfsmap_file = download_nfsmap(ip) nfslist = process_nfsmap_file(nfsmap_file) #else treat it as a single mount point - else: - item = (systemconfig["NFSserver"] , systemconfig["NFSmount"]) - nfslist.append(item) - setup_nfs_fstab(nfslist) - + else: + item = (systemconfig["NFSserver"] , systemconfig["NFSmount"]) + nfslist.append(item) + setup_nfs_fstab(nfslist) logging.info("__End of nfs\n") def setup_sleep(systemconfig): @@ -120,7 +122,7 @@ def process_nfsmap_file(mapfile): logging.debug(" %s",item) nfslist.append(item) except : - logging.debug("Couldn't read file %s, or some other error",mapfile) + logging.critical("Couldn't read file %s, or some other error",mapfile) return nfslist def scrubnfs(templates): @@ -167,6 +169,6 @@ def setup_nfs_fstab(nfslist): f.write(line) f.close() except: - logging.debug(" Couldn't open /etc/fstab") + logging.critical(" *Couldn't open /etc/fstab for writing") logging.debug(" Done adding nfs paths to fstab") |