'Return True if the LDEV is in the device group, False otherwise.'

def _check_device_grp(self, group_name, ldev, ldev_name=None):

    result = self.run_raidcom('get', 'device_grp', '-device_grp_name', group_name)
    for line in result[1].splitlines()[1:]:
        line = line.split()
        if (int(line[2]) == ldev):
            if (not ldev_name):
                return True
            else:
                return (line[1] == ldev_name)
    return False
