@classmethod
  def UpdateCache(cls, dev_path, owner, on_primary, iv_name):
    if dev_path is None:
      logging.error("DevCacheManager.UpdateCache got a None dev_path")
      return
    fpath = cls._ConvertPath(dev_path)
    if on_primary:
      state = "primary"
    else:
      state = "secondary"
    if iv_name is None:
      iv_name = "not_visible"
    fdata = "%s %s %s\n" % (str(owner), state, iv_name)
    try:
      utils.WriteFile(fpath, data=fdata)
    except EnvironmentError, err:
      logging.exception("Can't update bdev cache for %s: %s", dev_path, err)
Test index page with login at /infrastructure/status/add/
dataset/ETHPy150Open ganeti/ganeti/lib/backend.py/DevCacheManager.UpdateCache--crossover with--dataset/ETHPy150Open treeio/treeio/treeio/infrastructure/tests.py/InfrastructureViewsTest.test_infrastructure_status_add