Only update the bootstrap script on request. Fixes #9535.

This commit is contained in:
Pedro Algarvio 2014-01-03 01:24:17 +00:00
parent ca79876787
commit ad54eca1ab

View file

@ -106,28 +106,39 @@ exec(compile(open(SALT_SYSPATHS).read(), SALT_SYSPATHS, 'exec'))
class CloudSdist(sdist): class CloudSdist(sdist):
user_options = sdist.user_options + [ user_options = sdist.user_options + [
('skip-bootstrap-download', None, ('skip-bootstrap-download', None,
'Skip downloading the bootstrap-salt.sh script. This can also be ' '[DEPRECATED] Skip downloading the bootstrap-salt.sh script. This '
'triggered by having `SKIP_BOOTSTRAP_DOWNLOAD=1` as an environment ' 'can also be triggered by having `SKIP_BOOTSTRAP_DOWNLOAD=1` as an '
'variable.') 'environment variable.'),
('download-bootstrap-script', None,
'Download the latest stable bootstrap-salt.sh script. This '
'can also be triggered by having `DOWNLOAD_BOOTSTRAP_SCRIPT=1` as an '
'environment variable.')
] ]
boolean_options = sdist.boolean_options + [ boolean_options = sdist.boolean_options + [
'skip-bootstrap-download' 'skip-bootstrap-download',
'download-bootstrap-script'
] ]
def initialize_options(self): def initialize_options(self):
sdist.initialize_options(self) sdist.initialize_options(self)
self.skip_bootstrap_download = False self.skip_bootstrap_download = True
self.download_bootstrap_script = False
def finalize_options(self): def finalize_options(self):
sdist.finalize_options(self) sdist.finalize_options(self)
if 'SKIP_BOOTSTRAP_DOWNLOAD' in os.environ: if 'SKIP_BOOTSTRAP_DOWNLOAD' in os.environ:
skip_bootstrap_download = os.environ.get( log('Please stop using \'SKIP_BOOTSTRAP_DOWNLOAD\' and use '
'SKIP_BOOTSTRAP_DOWNLOAD', '0' '\'DOWNLOAD_BOOTSTRAP_SCRIPT\' instead')
if 'DOWNLOAD_BOOTSTRAP_SCRIPT' in os.environ:
download_bootstrap_script = os.environ.get(
'DOWNLOAD_BOOTSTRAP_SCRIPT', '0'
) )
self.skip_bootstrap_download = skip_bootstrap_download == '1' self.download_bootstrap_script = download_bootstrap_script == '1'
def run(self): def run(self):
if self.skip_bootstrap_download is False: if self.download_bootstrap_script is True:
# Let's update the bootstrap-script to the version defined to be # Let's update the bootstrap-script to the version defined to be
# distributed. See BOOTSTRAP_SCRIPT_DISTRIBUTED_VERSION above. # distributed. See BOOTSTRAP_SCRIPT_DISTRIBUTED_VERSION above.
url = ( url = (