Commit 32cbcc89 authored by Łukasz Nowak's avatar Łukasz Nowak

grid: Do not upload to binary cache with shared parts

Shared parts can be detected by presence of .shared file or presence of any
shared_part_list paths in .installed.cfg, and in such case do not allow to
upload to binary cache.

It's better than checking presence of shared_part_list in the configuration,
as this does not give real information if the shared technique was using
during installing given release.
parent 0e502ce9
......@@ -193,9 +193,26 @@ class Software(object):
else:
self._install_from_buildout()
# Upload to binary cache if possible and allowed
if all([self.software_root, self.url, self.software_url_hash,
self.upload_binary_cache_url, self.upload_binary_dir_url,
not os.path.exists(os.path.join(self.software_path, '.shared'))]):
upload_allowed = all([
self.software_root, self.url, self.software_url_hash,
self.upload_binary_cache_url, self.upload_binary_dir_url])
if upload_allowed:
shared_used = False
if os.path.exists(installed_cfg):
with open(installed_cfg, 'r') as installed_h:
installed = installed_h.read()
for part_list_directory in self.shared_part_list.split():
part_list_directory = part_list_directory.split()
if part_list_directory and part_list_directory in installed:
shared_used = True
break
if shared_used or os.path.exists(
os.path.join(self.software_path, '.shared')):
upload_allowed = False
self.logger.info(
"Will not upload to binary cache, as shared parts are used.")
installed_cfg = os.path.join(self.software_path, '.installed.cfg')
if upload_allowed:
blacklisted = False
for url in self.upload_to_binary_cache_url_blacklist:
if self.url.startswith(url):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment