abderrahim commented on code in PR #1991:
URL: https://github.com/apache/buildstream/pull/1991#discussion_r1942931561
##########
src/buildstream/buildelement.py:
##########
@@ -228,14 +228,23 @@ def configure_dependencies(self, dependencies):
# Determine the location to stage each element, default is "/"
location = "/"
if dep.config:
- dep.config.validate_keys(["location"])
+ dep.config.validate_keys(["digest-environment", "location"])
location = dep.config.get_str("location")
try:
element_list = self.__layout[location]
except KeyError:
element_list = []
self.__layout[location] = element_list
+ # Determine the optional digest environment variable to stage each
+ # element,default is None
+ digest_environment = None
+ if dep.config:
+ dep.config.validate_keys(["digest-environment", "location"])
Review Comment:
You only need to validate the keys once (above is good)
##########
src/buildstream/buildelement.py:
##########
@@ -228,14 +228,23 @@ def configure_dependencies(self, dependencies):
# Determine the location to stage each element, default is "/"
location = "/"
if dep.config:
- dep.config.validate_keys(["location"])
+ dep.config.validate_keys(["digest-environment", "location"])
location = dep.config.get_str("location")
try:
element_list = self.__layout[location]
except KeyError:
element_list = []
self.__layout[location] = element_list
+ # Determine the optional digest environment variable to stage each
+ # element,default is None
+ digest_environment = None
+ if dep.config:
+ dep.config.validate_keys(["digest-environment", "location"])
+ if "digest-environment" in dep.config:
+ digest_environment =
dep.config.get_str("digest-environment")
+ self.__digest_environment = digest_environment
Review Comment:
This should be a dict so as to allow more than one element to set the new
config option.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]