def ExpandInstanceName(self, short_name):
    # Locking is done in L{ConfigWriter.GetAllInstancesInfo}
    all_insts = self.GetAllInstancesInfo().values()
    expanded_name = _MatchNameComponentIgnoreCase(
                      short_name, [inst.name for inst in all_insts])

    if expanded_name is not None:
      # there has to be exactly one instance with that name
      inst = (filter(lambda n: n.name == expanded_name, all_insts)[0])
      return (inst.uuid, inst.name)
    else:
      return (None, None)
Attempt to expand an incomplete instance name.
dataset/ETHPy150Open ganeti/ganeti/lib/config/__init__.py/ConfigWriter.ExpandInstanceName