Пример #1
0
def get_hosts(parent=None):
    hostname = socket.gethostname()

    cluster_name = o2cb_ctl.get_active_cluster_name(parent)

    nodes = o2cb_ctl.get_cluster_nodes(cluster_name, parent)

    remote_nodes = [node['name'] for node in nodes if node['name'] != hostname]

    return cluster_name, remote_nodes
Пример #2
0
def node_config(parent=None):
    success, output, k = o2cb_ctl.init_status(None, parent)
    if not success:
        msg = ('Could not query the state of the cluster stack.'
               'This must be resolved before any OCFS2 filesystem'
               'can be mounted.')
        info = gtk.MessageDialog(parent=parent,
                                 flags=gtk.DIALOG_DESTROY_WITH_PARENT,
                                 type=gtk.MESSAGE_WARNING,
                                 buttons=gtk.BUTTONS_CLOSE,
                                 message_format=msg)
        info.run()
        info.destroy()
        return

    if (output.find('Not loaded') != -1) or (output.find('Not mounted') != -1):
        success, output, k = o2cb_ctl.init_load(parent)

        if success:
            msg_type = gtk.MESSAGE_INFO
            msg = ('The cluster stack has been started. It needs to be '
                   'running for any clustering functionality to happen. '
                   'Please run "%s enable" to have it started upon bootup.' %
                   o2cb_ctl.O2CB_INIT)
        else:
            msg_type = gtk.MESSAGE_WARNING
            msg = ('Could not start cluster stack. This must be resolved '
                   'before any OCFS2 filesystem can be mounted')

        info = gtk.MessageDialog(parent=parent,
                                 flags=gtk.DIALOG_DESTROY_WITH_PARENT,
                                 type=msg_type,
                                 buttons=gtk.BUTTONS_CLOSE,
                                 message_format=msg)

        info.run()
        info.destroy()

        if not success:
            return

    try:
        cluster_name = o2cb_ctl.get_active_cluster_name(parent)
    except o2cb_ctl.CtlError, e:
        error_box(parent, str(e))
        return
Пример #3
0
def node_config(parent=None):
    success, output, k = o2cb_ctl.init_status(None, parent)
    if not success:
        msg = ('Could not query the state of the cluster stack.'
               'This must be resolved before any OCFS2 filesystem'
               'can be mounted.')
        info = gtk.MessageDialog(parent=parent,
                                 flags=gtk.DIALOG_DESTROY_WITH_PARENT,
                                 type=gtk.MESSAGE_WARNING,
                                 buttons=gtk.BUTTONS_CLOSE,
                                 message_format=msg)
        info.run()
        info.destroy()
        return

    if (output.find('Not loaded') != -1) or (output.find('Not mounted') != -1):
        success, output, k = o2cb_ctl.init_load(parent)

        if success:
            msg_type = gtk.MESSAGE_INFO
            msg = ('The cluster stack has been started. It needs to be '
                   'running for any clustering functionality to happen. '
                   'Please run "%s enable" to have it started upon bootup.'
                   % o2cb_ctl.O2CB_INIT)
        else:
            msg_type = gtk.MESSAGE_WARNING
            msg = ('Could not start cluster stack. This must be resolved '
                   'before any OCFS2 filesystem can be mounted')

        info = gtk.MessageDialog(parent=parent,
                                 flags=gtk.DIALOG_DESTROY_WITH_PARENT,
                                 type=msg_type,
                                 buttons=gtk.BUTTONS_CLOSE,
                                 message_format=msg)

        info.run()
        info.destroy()

        if not success:
            return

    try:
        cluster_name = o2cb_ctl.get_active_cluster_name(parent)
    except o2cb_ctl.CtlError, e:
        error_box(parent, str(e))
        return