Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1508)

Unified Diff: services/service_manager/public/tools/manifest/manifest_collator.py

Issue 2651953002: Revert of [Service Manager] Get rid of dynamic service discovery (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: services/service_manager/public/tools/manifest/manifest_collator.py
diff --git a/services/service_manager/public/tools/manifest/manifest_collator.py b/services/service_manager/public/tools/manifest/manifest_collator.py
index be305618291360b72adfeb5492f07991b3f694df..90d21e7827e78392aba044de98d8a5dba8b1352e 100755
--- a/services/service_manager/public/tools/manifest/manifest_collator.py
+++ b/services/service_manager/public/tools/manifest/manifest_collator.py
@@ -18,7 +18,7 @@
"display_name",
]
-eater_relative = "../../../../../../tools/json_comment_eater"
+eater_relative = '../../../../../../tools/json_comment_eater'
eater_relative = os.path.join(os.path.abspath(__file__), eater_relative)
sys.path.insert(0, os.path.normpath(eater_relative))
try:
@@ -66,22 +66,6 @@
manifest[key] = overlay[key]
-def SanityCheckManifestServices(manifest):
- """Ensures any given service name appears only once within a manifest."""
- known_services = set()
- def has_no_dupes(root):
- if "name" in root:
- name = root["name"]
- if name in known_services:
- raise ValueError(
- "Duplicate manifest entry found for service: %s" % name)
- known_services.add(name)
- if "services" not in root:
- return True
- return all(has_no_dupes(service) for service in root["services"])
- return has_no_dupes(manifest)
-
-
def main():
parser = argparse.ArgumentParser(
description="Collate Service Manifests.")
@@ -96,31 +80,27 @@
parent = ParseJSONFile(args.parent)
- service_name = parent["name"] if "name" in parent else ""
- if args.name and args.name != service_name:
+ service_path = parent['name']
+ if args.name and args.name != service_path:
raise ValueError("Service name '%s' specified in build file does not " \
"match name '%s' specified in manifest." %
- (args.name, service_name))
+ (args.name, service_path))
packaged_services = []
for child_manifest in args.packaged_services:
packaged_services.append(ParseJSONFile(child_manifest))
if len(packaged_services) > 0:
- if "services" not in parent:
- parent["services"] = packaged_services
+ if 'services' not in parent:
+ parent['services'] = packaged_services
else:
- parent["services"].extend(packaged_services)
+ parent['services'].extend(packaged_services)
for overlay_path in args.overlays:
MergeManifestOverlay(parent, ParseJSONFile(overlay_path))
- with open(args.output, "w") as output_file:
+ with open(args.output, 'w') as output_file:
json.dump(parent, output_file, indent=2 if args.pretty else -1)
-
- # NOTE: We do the sanity check and possible failure *after* outputting the
- # aggregate manifest so it's easier to inspect erroneous output.
- SanityCheckManifestServices(parent)
return 0
« no previous file with comments | « services/service_manager/public/service_manifest.gni ('k') | services/service_manager/runner/host/service_process_launcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698