Пример #1
0
def fsck_volume(parent, device, check=False):
    if check:
        check_str = 'check'
    else:
        check_str = 'repair'

    title = 'File System ' + check_str.capitalize()

    dialog = TerminalDialog(parent=parent, title=title)
    terminal = dialog.terminal

    dialog.finished = False
    terminal.connect('child-exited', child_exited, dialog)

    command = fsck_command(device, check)
    gobject.idle_add(start_command, terminal, command, dialog)

    while 1:
        dialog.run()

        if dialog.finished:
            break

        msg = ('File system %s is still running. You should not close this '
               'window until it is finished' % check_str)

        info = gtk.MessageDialog(parent=dialog,
                                 flags=gtk.DIALOG_DESTROY_WITH_PARENT,
                                 type=gtk.MESSAGE_WARNING,
                                 buttons=gtk.BUTTONS_CLOSE,
                                 message_format=msg)
        info.run()
        info.destroy()

    dialog.destroy()
Пример #2
0
def fsck_volume(parent, device, check=False):
    if check:
        check_str = 'check'
    else:
        check_str = 'repair'

    title = 'File System ' + check_str.capitalize()

    dialog = TerminalDialog(parent=parent, title=title)
    terminal = dialog.terminal

    dialog.finished = False
    terminal.connect('child-exited', child_exited, dialog)

    command = fsck_command(device, check)
    gobject.idle_add(start_command, terminal, command, dialog)

    while 1:
        dialog.run()

        if dialog.finished:
            break

        msg = ('File system %s is still running. You should not close this '
               'window until it is finished' % check_str)

        info = gtk.MessageDialog(parent=dialog,
                                 flags=gtk.DIALOG_DESTROY_WITH_PARENT,
                                 type=gtk.MESSAGE_WARNING,
                                 buttons=gtk.BUTTONS_CLOSE,
                                 message_format=msg)
        info.run()
        info.destroy()
 
    dialog.destroy()
Пример #3
0
def push_config(parent=None):
    try:
        cluster_name, hosts = get_hosts(parent)
    except o2cb_ctl.CtlError, e:
        error_box(parent, str(e))
        return

    try:
        command = generate_command(cluster_name)
    except IOError, e:
        error_box(parent, str(e))
        return

    title = 'Propagate Cluster Configuration'

    dialog = TerminalDialog(parent=parent, title=title)
    terminal = dialog.terminal

    dialog.finished = False
    dialog.show_all()

    host_iter = iter(hosts)
    terminal.connect('child-exited', propagate, dialog, command, host_iter)

    propagate(terminal, dialog, command, host_iter)

    while 1:
        dialog.run()

        if dialog.finished:
            break