Ejemplo n.º 1
0
 def load_state(self):
     try:
         return state.load()
     except IOError as ex:
         if ex.errno == errno.ENOENT: # No such file or directory
             print 'No mongod running'
             exit(0)
Ejemplo n.º 2
0
def test_stateloader_should_load_existing_state(tmpdir):
    state.dump({'pids': [1, 2]})

    s = state.load()

    assert isinstance(s, State)
    assert [1, 2] == s.pids
Ejemplo n.º 3
0
def test_stateloader_should_load_existing_state(tmpdir):
    state.dump({'pids': [1,2]})

    s = state.load()
    
    assert isinstance(s, State)
    assert [1,2] == s.pids
Ejemplo n.º 4
0
def test_kill_should_kill_just_specific_nodes():
    run('create')
    assert_mongods_running(3)

    run('killnodes 2 3')
    assert_mongods_running(1)

    nodes = state.load()
    assert ['1'] == nodes.keys()
def test_kill_should_kill_just_specific_nodes():
    run('create')
    assert_mongods_running(3)

    run('killnodes 2 3')
    assert_mongods_running(1)

    nodes = state.load()
    assert ['1'] == nodes.keys()