@OrFail("Removing disk template")
  def UpgradeDiskTemplate(self):
    if "instances" not in self.config_data:
      raise Error("Can't find the 'instances' dictionary in the configuration.")
    instances = self.config_data["instances"]
    for inst in instances.values():
      if "disk_template" in inst:
        del inst["disk_template"]

  # The following function is based on a method of class Disk with the same
  # name, but adjusted to work with dicts and sets.
dataset/ETHPy150Open ganeti/ganeti/lib/tools/cfgupgrade.py/CfgUpgrade.UpgradeDiskTemplate/original