Esempio n. 1
0
import ConfigParser
import logging
import commands
import MySQLdb
import socket
from eayunstack_tools.logger import fmt_print
from eayunstack_tools.doctor.config import get_db_profile, get_component_check_cmd
from eayunstack_tools.doctor.config import *
from eayunstack_tools.doctor.utils import get_node_role, check_service
from eayunstack_tools.doctor.utils import run_doctor_on_nodes
from eayunstack_tools.utils import NODE_ROLE
from eayunstack_tools.sys_utils import ssh_connect2
from eayunstack_tools.logger import StackLOG as LOG
from eayunstack_tools.pythonclient import PythonClient

node_role = get_node_role()


def check_profile(profile, role):
    # if the profile file is not exists, go back
    if not os.path.exists(profile):
        LOG.error('Can not find this profile. Abort this check!')
        return

    # get template path
    template = get_template_path(profile, role)

    # if the template file is not exists, go back
    if not os.path.exists(template):
        LOG.error('Template file is missing, Please check it by yourself.')
        return
Esempio n. 2
0
import ConfigParser
import logging
import commands
import MySQLdb
import socket
from eayunstack_tools.logger import fmt_print
from eayunstack_tools.doctor.config import get_db_profile, get_component_check_cmd
from eayunstack_tools.doctor.config import *
from eayunstack_tools.doctor.utils import get_node_role, check_service
from eayunstack_tools.doctor.utils import run_doctor_on_nodes
from eayunstack_tools.utils import NODE_ROLE
from eayunstack_tools.sys_utils import ssh_connect2
from eayunstack_tools.logger import StackLOG as LOG
from eayunstack_tools.pythonclient import PythonClient

node_role = get_node_role()

def check_profile(profile, role):
    # if the profile file is not exists, go back
    if not os.path.exists(profile):
        LOG.error('Can not find this profile. Abort this check!')
        return

    # get template path
    template = get_template_path(profile, role)

    # if the template file is not exists, go back
    if not os.path.exists(template):
        LOG.error('Template file is missing, Please check it by yourself.')
        return
Esempio n. 3
0
#check openstack compent
import logging
from eayunstack_tools.doctor import common, config, utils
from eayunstack_tools.doctor.utils import register_decorater, userful_msg
from eayunstack_tools.logger import fmt_print
from eayunstack_tools.logger import StackLOG as LOG
from eayunstack_tools.doctor.config import *
from eayunstack_tools.doctor.utils import get_node_role
from eayunstack_tools.doctor.stack_func import *
from eayunstack_tools.utils import NODE_ROLE

register = register_decorater()
node_roles = get_node_role()


def stack(parser):
    # if node role is "unknow", go back
    if NODE_ROLE.is_unknown():
        LOG.error('Can not confirm the node role!')
        return
    if not NODE_ROLE.is_fuel():
        if parser.CONTROLLER:
            if not NODE_ROLE.is_controller():
                cmd_warn('controller')
                return
        if parser.COMPUTE:
            if not NODE_ROLE.is_compute():
                cmd_warn('compute')
                return
        if parser.MONGO:
            if not NODE_ROLE.is_mongo():
Esempio n. 4
0
#check openstack compent
import logging
from eayunstack_tools.doctor import common, config, utils
from eayunstack_tools.utils import register_decorater, userful_msg
from eayunstack_tools.logger import fmt_print
from eayunstack_tools.doctor.config import *
from eayunstack_tools.doctor.utils import get_node_role
from eayunstack_tools.doctor.stack_func import *
from eayunstack_tools.utils import NODE_ROLE

LOG = logging.getLogger(__name__)

register = register_decorater()
node_roles = get_node_role()

def stack(parser):
    # if node role is "unknow", go back
    if NODE_ROLE.is_unknown():
        LOG.error('Can not confirm the node role!')
        return
    if not NODE_ROLE.is_fuel():
        if parser.CONTROLLER:
            if not NODE_ROLE.is_controller():
                cmd_warn('controller')
                return
        if parser.COMPUTE:
            if not NODE_ROLE.is_compute():
                cmd_warn('compute')
                return
        if parser.MONGO:
            if not NODE_ROLE.is_mongo():