def main()

in VMExtension/hpcnodemanager.py [0:0]


def main():
    waagent.LoggerInit('/var/log/waagent.log','/dev/stdout')
    waagent.Log('Microsoft.HpcPack Linux NodeAgent started to handle.')
    global DistroName, DistroVersion, osutil, CGroupV2
    distro = get_dist_info()
    DistroName = distro[0].lower()
    # waagent common lib returns 'rhel' than 'redhat' since 9, rename to 'redhat' here to minimize the change needed
    if DistroName == 'rhel':
        DistroName = 'redhat'
    DistroVersion = distro[1]
    CGroupV2 = os.path.exists("/sys/fs/cgroup/cgroup.controllers")
    osutil = get_osutil()
    for a in sys.argv[1:]:        
        if re.match("^([-/]*)(disable)", a):
            disable()
        elif re.match("^([-/]*)(uninstall)", a):
            uninstall()
        elif re.match("^([-/]*)(install)", a):
            install()
        elif re.match("^([-/]*)(enable)", a):
            enable()
        elif re.match("^([-/]*)(daemon)", a):
            daemon()            
        elif re.match("^([-/]*)(update)", a):
            update()