Commits

Alessio Deiana  committed f519037

Fixes configurations files reloading

  • Participants
  • Parent commits 6b8af7a

Comments (0)

Files changed (2)

File src/invenio_devserver/config.py

     'py': 'lib/python/invenio',
     'js': 'var/www/js',
     'css': 'var/www/css',
-    'conf': None,
+    'conf': 'etc',
 }
 
 STATIC_FILES = {

File src/invenio_devserver/serve.py

         ))
 
     return chain(chain(*(iter_folder(folder) for folder in invenio_path)),
-                 ['%setc/invenio-local.conf' % config.INSTALL_PATH])
+                [os.path.join(config.INSTALL_PATH, 'etc/invenio-local.conf')])
 
 
 def select_destination_path(filename, install_path=config.INSTALL_PATH,
 
 
 def update_conf():
-    _log('info', 'updating configuration')
+    _log('info', ' * Updating configuration')
     ret = os.system('%s/bin/inveniocfg --update-config-py' \
                                                          % config.INSTALL_PATH)
     if ret == 0:
                 # finish writing the file
                 time.sleep(0.1)
 
-                if os.path.basename(filename) in (config.CONFIG_FILENAME,
-                                                 config.LOCAL_CONFIG_FILENAME):
-                    update_conf()
-
                 if os.path.basename(filename) == config.LOCAL_CONFIG_FILENAME:
                     dest = None
                 else:
                     dest = select_destination_path(filename)
+
                 if dest:
                     _log('info', ' * Detected change in %r, '\
                                         'copying to %s' % (filename, dest))
                     shutil.copyfile(filename, dest)
                 else:
                     _log('info', ' * Detected change in %r' % filename)
+
+                if os.path.basename(filename) in (config.CONFIG_FILENAME,
+                                                 config.LOCAL_CONFIG_FILENAME):
+                    update_conf()
+
                 has_changes = True
 
         if has_changes and reloader: