def _write_hostname(self, hostname, filename): conf = None try: # Try to update the previous one # Let's see if we can read it first. conf = HostnameConf(util.load_file(filename)) conf.parse() except IOError: pass if not conf: conf = HostnameConf('') conf.set_hostname(hostname) util.write_file(filename, str(conf), mode=0o644)
def _read_hostname_conf(self, filename): conf = HostnameConf(util.load_file(filename)) conf.parse() return conf
def _read_hostname_conf(self, filename): conf = HostnameConf(util.load_file(filename)) conf.parse() return conf