summaryrefslogtreecommitdiffstats
path: root/abs/core/LinHES-config/mv_supplemental.py
blob: 2b8bd2fd77d113c1ffc2a3c6465c027af5b856f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# -*- coding: utf-8 -*-
import logging, mv_common
import os, re

config_file = "mv_config"

def windowmanager(systemconfig):
    logging.info("____Start of windowmanager setup____")
    try:
        windowmanager = systemconfig.get("windowmanager")
    except:
        windowmanager = "default"
        return

    if windowmanager == ""  or windowmanager == None:
        windowmanager = "default"
    try:
        style = systemconfig.get("EnhancedWMStyle")
    except:
        style = ""

    if style == "1" and windowmanager != "default" :
        style = "enhanced"
    else:
        style = ""

    mv_common.pacinstall("alt_wm")
    cmd = '''/usr/LH/bin/set_windowmanager.sh %s %s ''' %(windowmanager,style)
    print cmd
    mv_common.runcmd(cmd)
    logging.info("__End of windowmanager \n")


def supplemental(systemconfig,this_is_install = False):
    logging.info("____Start of supplemental config ____")
    try:
        supplemental=systemconfig.get("supplemental")
    except:
        supplemental = "0"
    if supplemental == "1":
        logging.info("     Installing supplemental system\n")
        if this_is_install == True:
            if os.path.exists('/home/xymon/server'):
                cmd='''pacman --noconfirm --dbonly -Sddf xymonserver'''
                mv_common.runcmd(cmd)

        cmd='''/usr/LH/bin/install_supplemental_service.sh'''
        mv_common.runcmd(cmd)
    logging.info("__End of supplemental\n")