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
try: cluster_name = o2cb_ctl.get_active_cluster_name(parent) except o2cb_ctl.CtlError, e: error_box(parent, str(e)) return try: conf = ClusterConfig(cluster_name, parent) except ConfigError, e: error_box(parent, '%s: Could not query cluster configuration' % str(e)) return conf.run() conf.destroy() success, output, k = o2cb_ctl.init_status(cluster_name, parent) if not success: msg = ('Could not query the state of the cluster.' '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('Online') == -1: success, output, k = o2cb_ctl.init_online(cluster_name, parent)