[Notes] [Git][BuildGrid/buildgrid][jmac/expand-user-for-tls] 2 commits: Add !expand-path tag which informs parser to expand input.



Title: GitLab

finn pushed to branch jmac/expand-user-for-tls at BuildGrid / buildgrid

Commits:

4 changed files:

Changes:

  • buildgrid/_app/settings/cas.yml
    ... ... @@ -17,7 +17,7 @@ instances:
    17 17
     
    
    18 18
         storages:
    
    19 19
             - !disk-storage &main-storage
    
    20
    -          path: ~/cas/
    
    20
    +          path: !expand-path ~/cas/
    
    21 21
     
    
    22 22
         services:
    
    23 23
           - !cas
    

  • buildgrid/_app/settings/default.yml
    ... ... @@ -17,7 +17,7 @@ instances:
    17 17
     
    
    18 18
         storages:
    
    19 19
             - !disk-storage &main-storage
    
    20
    -          path: ~/cas/
    
    20
    +          path: !expand-path ~/cas/
    
    21 21
     
    
    22 22
         services:
    
    23 23
           - !action-cache &main-action
    

  • buildgrid/_app/settings/parser.py
    ... ... @@ -68,12 +68,21 @@ class Channel(YamlFactory):
    68 68
                     sys.exit(-1)
    
    69 69
     
    
    70 70
     
    
    71
    +class ExpandPath(YamlFactory):
    
    72
    +
    
    73
    +    yaml_tag = u'!expand-path'
    
    74
    +
    
    75
    +    def __new__(cls, path):
    
    76
    +        path = os.path.expanduser(path)
    
    77
    +        path = os.path.expandvars(path)
    
    78
    +        return path
    
    79
    +
    
    80
    +
    
    71 81
     class Disk(YamlFactory):
    
    72 82
     
    
    73 83
         yaml_tag = u'!disk-storage'
    
    74 84
     
    
    75 85
         def __new__(cls, path):
    
    76
    -        path = os.path.expanduser(path)
    
    77 86
             return DiskStorage(path)
    
    78 87
     
    
    79 88
     
    
    ... ... @@ -197,6 +206,7 @@ def _parse_size(size):
    197 206
     def get_parser():
    
    198 207
     
    
    199 208
         yaml.SafeLoader.add_constructor(Channel.yaml_tag, Channel.from_yaml)
    
    209
    +    yaml.SafeLoader.add_constructor(ExpandPath.yaml_tag, ExpandPath.from_yaml)
    
    200 210
         yaml.SafeLoader.add_constructor(Execution.yaml_tag, Execution.from_yaml)
    
    201 211
         yaml.SafeLoader.add_constructor(Action.yaml_tag, Action.from_yaml)
    
    202 212
         yaml.SafeLoader.add_constructor(Reference.yaml_tag, Reference.from_yaml)
    

  • buildgrid/_app/settings/remote-storage.yml
    ... ... @@ -19,10 +19,10 @@ instances:
    19 19
             - !remote-storage &main-storage
    
    20 20
               url: "http://localhost:50052"
    
    21 21
               instance_name: main
    
    22
    -          credentials:
    
    23
    -            tls-client-key: null
    
    24
    -            tls-client-cert: null
    
    25
    -            tls-server-cert: null
    
    22
    +#          credentials:
    
    23
    +#            tls-client-key: null
    
    24
    +#            tls-client-cert: null
    
    25
    +#            tls-server-cert: null
    
    26 26
     
    
    27 27
         services:
    
    28 28
           - !action-cache &main-action
    



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