Browse Source

Fix expanding "file=%(here)s" in [unix_http_server] section. Closes #677

Mike Naberezny 9 years ago
parent
commit
6ad2751277
1 changed files with 6 additions and 7 deletions
  1. 6 7
      supervisor/options.py

+ 6 - 7
supervisor/options.py

@@ -1016,13 +1016,12 @@ class ServerOptions(Options):
         for name, section in unix_serverdefs:
             config = {}
             get = parser.saneget
-            sfile = get(section, 'file', None)
+            sfile = get(section, 'file', None, expansions={'here': self.here})
             if sfile is None:
                 raise ValueError('section [%s] has no file value' % section)
             sfile = sfile.strip()
             config['name'] = name
             config['family'] = socket.AF_UNIX
-            sfile = expand(sfile, {'here':self.here}, 'socket file')
             config['file'] = normalize_path(sfile)
             config.update(self._parse_username_and_password(parser, section))
             chown = get(section, 'chown', None)
@@ -1587,11 +1586,10 @@ class ClientOptions(Options):
         sections = config.sections()
         if not 'supervisorctl' in sections:
             raise ValueError('.ini file does not include supervisorctl section')
-        serverurl = config.getdefault('serverurl', 'http://localhost:9001')
+        serverurl = config.getdefault('serverurl', 'http://localhost:9001',
+            expansions={'here': self.here})
         if serverurl.startswith('unix://'):
-            sf = serverurl[7:]
-            path = expand(sf, {'here':self.here}, 'serverurl')
-            path = normalize_path(path)
+            path = normalize_path(serverurl[7:])
             serverurl = 'unix://%s' % path
         section.serverurl = serverurl
 
@@ -1600,7 +1598,8 @@ class ClientOptions(Options):
         section.prompt = config.getdefault('prompt', section.prompt)
         section.username = config.getdefault('username', section.username)
         section.password = config.getdefault('password', section.password)
-        history_file = config.getdefault('history_file', section.history_file)
+        history_file = config.getdefault('history_file', section.history_file,
+            expansions={'here': self.here})
 
         if history_file:
             history_file = normalize_path(history_file)