Merge pull request #9559 from s0undt3ch/issues/9535-no-bootstrap-auto-download

Only update the bootstrap script on request. Fixes #9535.
This commit is contained in:
Thomas S Hatch 2014-01-03 08:21:49 -08:00
commit 951920a1b7

View File

@ -106,28 +106,39 @@ exec(compile(open(SALT_SYSPATHS).read(), SALT_SYSPATHS, 'exec'))
class CloudSdist(sdist):
user_options = sdist.user_options + [
('skip-bootstrap-download', None,
'Skip downloading the bootstrap-salt.sh script. This can also be '
'triggered by having `SKIP_BOOTSTRAP_DOWNLOAD=1` as an environment '
'variable.')
'[DEPRECATED] Skip downloading the bootstrap-salt.sh script. This '
'can also be triggered by having `SKIP_BOOTSTRAP_DOWNLOAD=1` as an '
'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 + [
'skip-bootstrap-download'
'skip-bootstrap-download',
'download-bootstrap-script'
]
def 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):
sdist.finalize_options(self)
if 'SKIP_BOOTSTRAP_DOWNLOAD' in os.environ:
skip_bootstrap_download = os.environ.get(
'SKIP_BOOTSTRAP_DOWNLOAD', '0'
log('Please stop using \'SKIP_BOOTSTRAP_DOWNLOAD\' and use '
'\'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):
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
# distributed. See BOOTSTRAP_SCRIPT_DISTRIBUTED_VERSION above.
url = (