'Create a provider tree from an `objects.ComputeNodeList` object.'

def __init__(self, cns=None):

    self.lock = lockutils.internal_lock(_LOCK_NAME)
    self.roots = []
    if cns:
        for cn in cns:
            p = _Provider(cn.hypervisor_hostname, cn.uuid)
            self.roots.append(p)
