Exemple #1
0
 def _fetch_latest_installer(self):
     '''
     Download the latest Windows installer executable
     '''
     name = win_installer.latest_installer_name()
     path = os.path.join(FILES, name)
     with salt.utils.files.fopen(path, 'wb') as fp:
         win_installer.download_and_verify(fp, name)
     return name
Exemple #2
0
    def __fetch_installer():
        # Determine the downloaded installer name by searching the files
        # directory for the first file that looks like an installer.
        for path, dirs, files in os.walk(RUNTIME_VARS.FILES):
            for file in files:
                if file.startswith(win_installer.PREFIX):
                    return file

        # If the installer wasn't found in the previous steps, download the latest Windows installer executable
        name = win_installer.latest_installer_name()
        path = os.path.join(RUNTIME_VARS.FILES, name)
        with salt.utils.files.fopen(path, "wb") as fp:
            win_installer.download_and_verify(fp, name)
        return name