File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -174,13 +174,18 @@ def load_descriptor(filepath, silent=False) -> dict:
174174 rawtext = f .read ()
175175 f .seek (0 )
176176 desc = json .load (f )
177+ # VIP-specific checks, in addition to "bosh validate".
178+ # These rules should be kept similar to those in VIP-portal/BoutiquesParser.java.
177179 appname = desc ["name" ]
178180 appversion = desc ["tool-version" ]
179- # check name and version strings
180- if not re .match (r"^[a-zA-Z0-9_\. +-]+$" , appname ):
181+ # check mandatory fields, and name+ version content
182+ if not re .match (r"^[a-zA-Z0-9_\.@ +-]+$" , appname ):
181183 raise ValueError ("invalid name '%s'" % appname )
182184 if not re .match (r"^[a-zA-Z0-9_\.@ +-]+$" , appversion ):
183185 raise ValueError ("invalid version '%s'" % appversion )
186+ # author field mandatory
187+ if "author" not in desc :
188+ raise ValueError ("%s: missing author" % filepath )
184189 # check container-image (just warnings)
185190 if not silent :
186191 if not "container-image" in desc :
You can’t perform that action at this time.
0 commit comments