I'm coming back on this MP as I just found some time to investigate that openerp.cfg addons_path that is not relative to the root of the chroot jail.
So, it's coming from server.py:
|- def _create_default_config(self):
|| """Have OpenERP generate its default config file.
|| """
|| self.options.setdefault('options.admin_passwd', '')
|| if self.major_version <= (6, 0):
|| # root-path not available as command-line option
|| os.chdir(join(self.openerp_dir, 'bin'))
|| subprocess.check_call([self.script_path, '--stop-after-init', '-s',
|| ])
|| else:
|| sys.path.extend([self.openerp_dir])
|| sys.path.extend([egg.location for egg in self.ws])
|| from openerp.tools.config import configmanager
|| configmanager(self.config_path).save()
I see 2 options:
1/ no improvement to this MP. Only python scripts are relative. However, each item in the addons path is prefixed by the path of the jail.
addons_path = /home/jbaudoux/chroot/opt/server/openerp/addons,....
and, inside the jail, workaround by creating a symlink /home/jbaudoux/chroot -> /
2/ don't use
|| from openerp.tools.config import configmanager
|| configmanager(self.config_path).save()
but run the jail start script like it was previously
|| subprocess.check_call([self.script_path, '--stop-after-init', '-s',
|| ])
where self.script_path has to be replaced by a new buildout variable specifying the script to run
This also has the advantage that if buildout is not run by the user that will run openerp, the openerp.cfg file gets the right ownership which is currently not the case.
What do you prefer? Option 1 is working fine (so I keep this MP as it is) but if you'd like to have option 2 implemented, I can make a MP to this MP.
Hi Georges,
I'm coming back on this MP as I just found some time to investigate that openerp.cfg addons_path that is not relative to the root of the chroot jail.
So, it's coming from server.py: default_ config( self): setdefault( 'options. admin_passwd' , '') join(self. openerp_ dir, 'bin')) check_call( [self.script_ path, '--stop- after-init' , '-s', extend( [self.openerp_ dir]) extend( [egg.location for egg in self.ws]) tools.config import configmanager self.config_ path).save( )
|- def _create_
|| """Have OpenERP generate its default config file.
|| """
|| self.options.
|| if self.major_version <= (6, 0):
|| # root-path not available as command-line option
|| os.chdir(
|| subprocess.
|| ])
|| else:
|| sys.path.
|| sys.path.
|| from openerp.
|| configmanager(
I see 2 options:
1/ no improvement to this MP. Only python scripts are relative. However, each item in the addons path is prefixed by the path of the jail. chroot/ opt/server/ openerp/ addons, .... chroot -> /
addons_path = /home/jbaudoux/
and, inside the jail, workaround by creating a symlink /home/jbaudoux/
2/ don't use tools.config import configmanager self.config_ path).save( ) check_call( [self.script_ path, '--stop- after-init' , '-s',
|| from openerp.
|| configmanager(
but run the jail start script like it was previously
|| subprocess.
|| ])
where self.script_path has to be replaced by a new buildout variable specifying the script to run
This also has the advantage that if buildout is not run by the user that will run openerp, the openerp.cfg file gets the right ownership which is currently not the case.
What do you prefer? Option 1 is working fine (so I keep this MP as it is) but if you'd like to have option 2 implemented, I can make a MP to this MP.