From 70054870b99b899035592d0e3c3a21492df201ba Mon Sep 17 00:00:00 2001 From: Giovanni Francesco Capalbo Date: Wed, 21 Oct 2020 12:54:02 +0200 Subject: [PATCH] [FIX] [no task] support buildouts without bootstrap.py , with only bootstrap.sh --- runbot_buildout/models/runbot_build.py | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/runbot_buildout/models/runbot_build.py b/runbot_buildout/models/runbot_build.py index 11d9fcc8..bae47295 100644 --- a/runbot_buildout/models/runbot_build.py +++ b/runbot_buildout/models/runbot_build.py @@ -237,15 +237,23 @@ def _bootstrap_buildout(self, lock_path, log_path, delete_server=True): bootstrap_file = self.env['ir.config_parameter'].get_param( 'runbot_buildout.bootstrap_file', 'bootstrap.py', ) - if not os.path.exists(self._path(bootstrap_file)): - with open(self._path(bootstrap_file), 'w') as bootstrap: - bootstrap.write( - requests.get( - 'https://raw.githubusercontent.com/buildout/buildout/' - 'master/bootstrap/bootstrap.py' - ).text - ) self._log('buildout', 'Bootstrapping buildout') + if not os.path.exists(self._path(bootstrap_file)): + # Python 3 buildouts don't have bootstrap.py. + # Bootstrap.py has been deprecated. this used to perform a wget, + # is now no longer working. Our new buildouts just have a + # self-sufficient bootstrap.sh. if there is no bootstrap.py, just + # execute that. + bootstrap_sh_file = self.env['ir.config_parameter'].get_param( + 'runbot_buildout.bootstrap_sh_file', 'bootstrap.sh', + ) + return self._spawn( + [ + '.', + self._path(bootstrap_sh_file), + ], + lock_path, log_path + ) return self._spawn( [ self.branch_id.get_interpreter(),