[Notes] [Git][BuildStream/buildstream][jennis/less_restrictive_pathways] _yaml.py: Fix incorrect error message



Title: GitLab

James Ennis pushed to branch jennis/less_restrictive_pathways at BuildStream / buildstream

Commits:

1 changed file:

Changes:

  • buildstream/_yaml.py
    ... ... @@ -475,12 +475,18 @@ def node_get_project_path(node, key, project_dir, *,
    475 475
         is_inside = project_dir_path.resolve() in full_resolved_path.parents or (
    
    476 476
             full_resolved_path == project_dir_path)
    
    477 477
     
    
    478
    -    if path.is_absolute() or not is_inside:
    
    478
    +    if not is_inside:
    
    479 479
             raise LoadError(LoadErrorReason.PROJ_PATH_INVALID,
    
    480 480
                             "{}: Specified path '{}' must not lead outside of the "
    
    481 481
                             "project directory"
    
    482 482
                             .format(provenance, path_str))
    
    483 483
     
    
    484
    +    if path.is_absolute():
    
    485
    +        raise LoadError(LoadErrorReason.PROJ_PATH_INVALID,
    
    486
    +                        "{}: Absolute pathway: '{}' invalid.\n"
    
    487
    +                        "Please specify a pathway relative to the project's root."
    
    488
    +                        .format(provenance, path))
    
    489
    +
    
    484 490
         if full_resolved_path.is_socket() or (
    
    485 491
                 full_resolved_path.is_fifo() or
    
    486 492
                 full_resolved_path.is_block_device()):
    



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