|
@@ -567,6 +567,7 @@ class ServerOptions(Options):
|
|
expansions = {'here':self.here}
|
|
expansions = {'here':self.here}
|
|
expansions.update(self.environ_expansions)
|
|
expansions.update(self.environ_expansions)
|
|
if parser.has_section('include'):
|
|
if parser.has_section('include'):
|
|
|
|
+ parser.expand_here(self.here)
|
|
if not parser.has_option('include', 'files'):
|
|
if not parser.has_option('include', 'files'):
|
|
raise ValueError(".ini file has [include] section, but no "
|
|
raise ValueError(".ini file has [include] section, but no "
|
|
"files setting")
|
|
"files setting")
|
|
@@ -591,6 +592,10 @@ class ServerOptions(Options):
|
|
parser.read(filename)
|
|
parser.read(filename)
|
|
except ConfigParser.ParsingError as why:
|
|
except ConfigParser.ParsingError as why:
|
|
raise ValueError(str(why))
|
|
raise ValueError(str(why))
|
|
|
|
+ else:
|
|
|
|
+ parser.expand_here(
|
|
|
|
+ os.path.abspath(os.path.dirname(filename))
|
|
|
|
+ )
|
|
|
|
|
|
sections = parser.sections()
|
|
sections = parser.sections()
|
|
if not 'supervisord' in sections:
|
|
if not 'supervisord' in sections:
|
|
@@ -1715,6 +1720,16 @@ class UnhosedConfigParser(ConfigParser.RawConfigParser):
|
|
self.section_to_file[section] = filename
|
|
self.section_to_file[section] = filename
|
|
return ok_filenames
|
|
return ok_filenames
|
|
|
|
|
|
|
|
+ def expand_here(self, here):
|
|
|
|
+ if here is None:
|
|
|
|
+ return
|
|
|
|
+ HERE_FORMAT = '%(here)s'
|
|
|
|
+ for section in self.sections():
|
|
|
|
+ for key, value in self.items(section):
|
|
|
|
+ if HERE_FORMAT in value:
|
|
|
|
+ value = value.replace(HERE_FORMAT, here)
|
|
|
|
+ self.set(section, key, value)
|
|
|
|
+
|
|
|
|
|
|
class Config(object):
|
|
class Config(object):
|
|
def __ne__(self, other):
|
|
def __ne__(self, other):
|