Example #1
0
 def _handle_test_mod_update(self, message):
     if compare_version(message.version, TEST_PACKAGE_VERSION_NUM) > 0:
         if not os.path.exists(TMP_DIR):
             os.mkdir(TMP_DIR)
         downloader = FileDownloader(
             message.downloadURL,
             os.path.join(TMP_DIR, 'test_' + message.version + '.py'))
         if message.HasField('checkCode'):
             downloader.addCallback(update_test_mod, message.version,
                                    message.checkCode)
         else:
             downloader.addCallback(update_test_mod, message.version)
         downloader.start()
Example #2
0
def download_update(url=None, check_code=None, version=None):
    """
    download and update 
    """
    downloader = FileDownloader(
        url, os.path.join(TMP_DIR, "icm-agent_" + str(version) + ".tar.gz"))
    if check_code == "" or check_code == None:
        check_code = 0
    else:
        check_code = check_code

    downloader.addCallback(update_agent, str(version), check_code)
    downloader.start()
Example #3
0
 def _handle_agent_update(self, message):
     if compare_version(message.version, VERSION) > 0:
         if not os.path.exists(TMP_DIR):
             os.mkdir(TMP_DIR)
         downloader = FileDownloader(
             message.downloadURL,
             os.path.join(TMP_DIR,
                          'icm-agent_' + message.version + '.tar.gz'))
         if message.HasField('checkCode'):
             check_code = message.checkCode
         else:
             check_code = 0
         downloader.addCallback(update_agent, message.version, check_code)
         downloader.start()