'Turn ulimits into an array of Ulimit objects'

def _parse_ulimits(self):

    if (self.ulimits is None):
        return None
    results = []
    for limit in self.ulimits:
        limits = dict()
        pieces = limit.split(':')
        if (len(pieces) >= 2):
            limits['name'] = pieces[0]
            limits['soft'] = int(pieces[1])
            limits['hard'] = int(pieces[1])
        if (len(pieces) == 3):
            limits['hard'] = int(pieces[2])
        try:
            results.append(Ulimit(**limits))
        except ValueError as exc:
            self.fail(('Error    parsing    ulimits    value    %s    -    %s' % (limit, exc)))
    return results
