#!/usr/bin/python

# Copyright (C) 2013:
#    Gabes Jean, j.gabes@shinken-solutions.com
#
# This file is part of Shinken Enterprise, all rights reserved.

import optparse

from shinkensolutions.localinstall import get_local_addons, VERSION, WARNING_COLOR, ERROR_COLOR, OK_COLOR, get_local_instances_for_type, POSSIBLE_DAEMONS, POSSIBLE_ADDONS, get_instance_name, get_local_daemon_configuration_file_path

if __name__ == '__main__':
    parser = optparse.OptionParser("%prog ", version="%prog: " + VERSION, description='This tool is used to list all locals addons enabled')
    
    opts, args = parser.parse_args()
    
    addons = get_local_addons()
    for a in POSSIBLE_ADDONS:
        enabled = False
        if a in addons:
            if addons[a]:
                enabled = True
        
        if enabled:
            print ' %s:\033[%dm ENABLED\033[0m' % (a.ljust(30), OK_COLOR)
        else:
            print ' %s:\033[%dm DISABLED\033[0m' % (a.ljust(30), WARNING_COLOR)
