def rename(self, old_host, new_host):
if new_host in self.hosts_:<EOL><INDENT>raise ValueError("<STR_LIT>" % new_host)<EOL><DEDENT>for line in self.lines_:  <EOL><INDENT>if line.host == old_host:<EOL><INDENT>line.host = new_host<EOL>if line.key.lower() == "<STR_LIT:host>":<EOL><INDENT>line.value = new_host<EOL>line.line = "<STR_LIT>" % new_host<EOL><DEDENT><DEDENT><DEDENT>self.hosts_.remove(old_host)  <EOL>self.hosts_.add(new_host)<EOL>
Renames a host configuration.

Parameters
----------
old_host : the host to rename.
new_host : the new host value