Пример #1
0
    def test_get_state(self, mock_len):

        zkclient = RsyncSource('dummy', session='new', netcat=True, rsyncpath='/path/dummy', rsyncdepth=2)
        mock_len.return_value = 5
        self.assertEqual(zkclient.get_state(), 0)
        mock_len.return_value = 0
        self.assertEqual(zkclient.get_state(), ZKRS_NO_SUCH_SESSION_EXIT_CODE)
Пример #2
0
    def test_get_state(self, mock_len):

        zkclient = RsyncSource('dummy',
                               session='new',
                               netcat=True,
                               rsyncpath='/path/dummy',
                               rsyncdepth=2)
        mock_len.return_value = 5
        self.assertEqual(zkclient.get_state(), 0)
        mock_len.return_value = 0
        self.assertEqual(zkclient.get_state(), ZKRS_NO_SUCH_SESSION_EXIT_CODE)
Пример #3
0
def get_state(servers, kwargs):
    """Get the state of a running session"""
    kwargs['verifypath'] = False  # Not needed for state info
    rsyncP = RsyncSource(servers, rsyncdepth=0, **kwargs)
    code = rsyncP.get_state()
    rsyncP.exit()
    sys.exit(code)
Пример #4
0
def get_state(servers, kwargs):
    """Get the state of a running session"""
    kwargs['verifypath'] = False # Not needed for state info
    rsyncP = RsyncSource(servers, rsyncdepth=0, **kwargs)
    code = rsyncP.get_state()
    rsyncP.exit()
    sys.exit(code)