Logo Search packages:      
Sourcecode: ganeti version File versions  Download package

def lib::config::ConfigWriter::RenameInstance (   self,
  old_name,
  new_name 
)

Rename an instance.

This needs to be done in ConfigWriter and not by RemoveInstance
combined with AddInstance as only we can guarantee an atomic
rename.

Definition at line 318 of file config.py.

00318                                               :
    """Rename an instance.

    This needs to be done in ConfigWriter and not by RemoveInstance
    combined with AddInstance as only we can guarantee an atomic
    rename.

    """
    self._OpenConfig()
    if old_name not in self._config_data.instances:
      raise errors.ConfigurationError("Unknown instance '%s'" % old_name)
    inst = self._config_data.instances[old_name]
    del self._config_data.instances[old_name]
    inst.name = new_name
    self._config_data.instances[inst.name] = inst
    self._WriteConfig()

  def MarkInstanceDown(self, instance_name):


Generated by  Doxygen 1.6.0   Back to index