예제 #1
0
def is_heal_complete(mnode, volname):
    """Verifies there are no pending heals on the volume.
        The 'number of entries' in the output of heal info
        for all the bricks should be 0 for heal to be completed.

    Args:
        mnode : Node on which commands are executed
        volname : Name of the volume

    Return:
        bool: True if heal is complete. False otherwise
    """
    from glustolibs.gluster.heal_ops import get_heal_info
    heal_info_data = get_heal_info(mnode, volname)
    if heal_info_data is None:
        g.log.error("Unable to verify whether heal is successful or not on "
                    "volume %s" % volname)
        return False

    heal_complete = True
    for brick_heal_info_data in heal_info_data:
        if brick_heal_info_data['numberOfEntries'] != '0':
            heal_complete = False

    if not heal_complete:
        g.log.error("Heal is not complete on some of the bricks for the "
                    "volume %s" % volname)
        return False
    g.log.info("Heal is complete on all the bricks for the volume %s" %
               volname)
    return True
예제 #2
0
def ec_check_heal_comp(self):
    g.log.info("Get the pending heal info for the volume %s", self.volname)
    heal_info = get_heal_info(self.mnode, self.volname)
    g.log.info("Successfully got heal info for the volume %s", self.volname)
    g.log.info("Heal Entries %s : %s", self.volname, heal_info)

    # Monitor heal completion
    ret = monitor_heal_completion(self.mnode, self.volname)
    self.assertTrue(ret, 'Heal has not yet completed')