config_var_re = re.compile(r"^ *([A-Z_]+)=(.*)\n?$", re.MULTILINE)
def __read_config_file(self, filename):
config_var_re = re.compile(r"^ *([A-Z_]+)=(.*)\n?$", re.MULTILINE)
def __read_config_file(self, filename):
changed = True
for (newkey, newval) in todo.items():
data += "%s=%s\n" % (newkey, newval)
changed = True
for (newkey, newval) in todo.items():
data += "%s=%s\n" % (newkey, newval)
- os.link(filename, filename + ".old")
+ backup = filename + ".old"
+ try:
+ os.unlink(backup)
+ except OSError, ex:
+ if ex.errno != errno.ENOENT:
+ raise
+ os.link(filename, backup)
print >>log, ("%s: starting the virtual server %s" %
(time.asctime(time.gmtime()), self.name))
print >>log, ("%s: starting the virtual server %s" %
(time.asctime(time.gmtime()), self.name))
for cmd in self.INITSCRIPTS + [None]:
# wait for previous command to terminate, unless it
# is the last one and the caller has specified to wait
for cmd in self.INITSCRIPTS + [None]:
# wait for previous command to terminate, unless it
# is the last one and the caller has specified to wait
# write new values to configuration file
self.__update_config_file(self.config_file, resources)
# write new values to configuration file
self.__update_config_file(self.config_file, resources)