[Notes] [Git][BuildStream/buildstream][tpollard/591] buildstream/_project.py: Report if project.conf is missing name



Title: GitLab

Tom Pollard pushed to branch tpollard/591 at BuildStream / buildstream

Commits:

1 changed file:

Changes:

  • buildstream/_project.py
    ... ... @@ -398,6 +398,13 @@ class Project():
    398 398
                     "Project requested format version {}, but BuildStream {}.{} only supports up until format version {}"
    
    399 399
                     .format(format_version, major, minor, BST_FORMAT_VERSION))
    
    400 400
     
    
    401
    +        # Check if project.conf contains name key field
    
    402
    +        try:
    
    403
    +            _yaml.node_get_provenance(pre_config_node, 'name')
    
    404
    +        except KeyError as e:
    
    405
    +            raise LoadError(LoadErrorReason.INVALID_DATA,
    
    406
    +                            "{}: project.conf does not contain expected key '{}'".format(projectfile, 'name'))
    
    407
    +
    
    401 408
             # The project name, element path and option declarations
    
    402 409
             # are constant and cannot be overridden by option conditional statements
    
    403 410
             self.name = _yaml.node_get(pre_config_node, str, 'name')
    



  • [Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]