| OLD | NEW |
| 1 # Copyright 2014 The LUCI Authors. All rights reserved. | 1 # Copyright 2014 The LUCI Authors. All rights reserved. |
| 2 # Use of this source code is governed by the Apache v2.0 license that can be | 2 # Use of this source code is governed under the Apache License, Version 2.0 |
| 3 # found in the LICENSE file. | 3 # that can be found in the LICENSE file. |
| 4 | 4 |
| 5 """Generates the swarming_bot.zip archive for the bot. | 5 """Generates the swarming_bot.zip archive for the bot. |
| 6 | 6 |
| 7 Unlike the other source files, this file can be run from ../tools/bot_archive.py | 7 Unlike the other source files, this file can be run from ../tools/bot_archive.py |
| 8 stand-alone to generate a swarming_bot.zip for local testing so it doesn't | 8 stand-alone to generate a swarming_bot.zip for local testing so it doesn't |
| 9 import anything from the AppEngine SDK. | 9 import anything from the AppEngine SDK. |
| 10 | 10 |
| 11 The hash of the content of the files in the archive is used to define the | 11 The hash of the content of the files in the archive is used to define the |
| 12 current version of the swarming bot code. | 12 current version of the swarming bot code. |
| 13 """ | 13 """ |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 h.update(str(len(name))) | 294 h.update(str(len(name))) |
| 295 h.update(name) | 295 h.update(name) |
| 296 h.update(str(len(content))) | 296 h.update(str(len(content))) |
| 297 h.update(content) | 297 h.update(content) |
| 298 except IOError: | 298 except IOError: |
| 299 logging.warning('Missing expected file. Hash will be invalid.') | 299 logging.warning('Missing expected file. Hash will be invalid.') |
| 300 bot_version = h.hexdigest() | 300 bot_version = h.hexdigest() |
| 301 logging.info( | 301 logging.info( |
| 302 'get_swarming_bot_version(%s) = %s', sorted(additionals), bot_version) | 302 'get_swarming_bot_version(%s) = %s', sorted(additionals), bot_version) |
| 303 return bot_version | 303 return bot_version |
| OLD | NEW |