aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/plugins/mdata/FEATURE.yaml4
-rwxr-xr-xsrc/scripts/fts.py35
2 files changed, 22 insertions, 17 deletions
diff --git a/src/plugins/mdata/FEATURE.yaml b/src/plugins/mdata/FEATURE.yaml
index c71281d777b..404739ee54a 100644
--- a/src/plugins/mdata/FEATURE.yaml
+++ b/src/plugins/mdata/FEATURE.yaml
@@ -2,12 +2,12 @@ name: Buffer Metadata Change Tracker (mdata)
maintainer: Dave Barach <dave@barachs.net>
features:
- Buffer Metadata Change Tracker
-description: "Buffer Metadata Change Tracker
+description: Buffer Metadata Change Tracker
Uses the before / after graph node main loop performance
callback hooks to snapshoot buffer metadata, then
compare and summarize results per-node.
Answers the question "what buffer metadata does a particular
graph node change?" by direct observation.
- Zero performance impact until enabled."
+ Zero performance impact until enabled.
state: production
properties: [API, CLI, MULTITHREAD]
diff --git a/src/scripts/fts.py b/src/scripts/fts.py
index 6d224ddffe4..eb44be9a59a 100755
--- a/src/scripts/fts.py
+++ b/src/scripts/fts.py
@@ -16,15 +16,16 @@ schema = {
"type": "object",
"properties": {
"name": {"type": "string"},
- "description": { "type": "string" },
- "maintainer": { "type": "string" },
+ "description": {"type": "string"},
+ "maintainer": {"type": "string"},
"state": {"type": "string",
"enum": ["production", "experimental"]},
- "features": { "$ref": "#/definitions/features" },
- "missing": { "$ref": "#/definitions/features" },
- "properties": { "type": "array",
- "items": { "type": "string",
- "enum": ["API", "CLI", "STATS", "MULTITHREAD"] },
+ "features": {"$ref": "#/definitions/features"},
+ "missing": {"$ref": "#/definitions/features"},
+ "properties": {"type": "array",
+ "items": {"type": "string",
+ "enum": ["API", "CLI", "STATS",
+ "MULTITHREAD"]},
},
},
"additionalProperties": False,
@@ -32,21 +33,20 @@ schema = {
"featureobject": {
"type": "object",
"patternProperties": {
- "^.*$": { "$ref": "#/definitions/features" },
+ "^.*$": {"$ref": "#/definitions/features"},
},
},
"features": {
"type": "array",
- "items": {"anyOf": [{ "$ref": "#/definitions/featureobject" },
- { "type": "string" },
- ]},
+ "items": {"anyOf": [{"$ref": "#/definitions/featureobject"},
+ {"type": "string"},
+ ]},
"minItems": 1,
},
},
}
-
def filelist_from_git_status():
filelist = []
git_status = 'git status --porcelain */FEATURE.yaml'
@@ -59,6 +59,7 @@ def filelist_from_git_status():
filelist.append(l.split()[1])
return filelist
+
def filelist_from_git_ls():
filelist = []
git_ls = 'git ls-files :(top)*/FEATURE.yaml'
@@ -71,17 +72,19 @@ def filelist_from_git_ls():
filelist.append(l)
return filelist
+
def output_features(indent, fl):
for f in fl:
if type(f) is dict:
- for k,v in f.items():
+ for k, v in f.items():
print('{}- {}'.format(' ' * indent, k))
output_features(indent + 2, v)
else:
print('{}- {}'.format(' ' * indent, f))
+
def output_markdown(features):
- for k,v in features.items():
+ for k, v in features.items():
print('# {}'.format(v['name']))
print('Maintainer: {} '.format(v['maintainer']))
print('State: {}\n'.format(v['state']))
@@ -92,6 +95,7 @@ def output_markdown(features):
output_features(0, v['missing'])
print()
+
def main():
parser = argparse.ArgumentParser(description='VPP Feature List.')
parser.add_argument('--validate', dest='validate', action='store_true',
@@ -120,12 +124,13 @@ def main():
# Load configuration file
with open(featurefile) as f:
- cfg = yaml.load(f)
+ cfg = yaml.load(f, Loader=yaml.SafeLoader)
validate(instance=cfg, schema=schema)
features[featurefile] = cfg
if args.markdown:
output_markdown(features)
+
if __name__ == '__main__':
main()