~canonical-platform-qa/autopilot/patch_registry_by_default

« back to all changes in this revision

Viewing changes to autopilot/introspection/_object_registry.py

  • Committer: Omer Akram
  • Date: 2016-06-27 12:46:17 UTC
  • Revision ID: omer.akram@canonical.com-20160627124617-0ro0gaixcoffx6mi
Proof of concept patched registry

Show diffs side-by-side

added added

removed removed

Lines of Context:
277
277
        raise
278
278
    finally:
279
279
        _object_registry = old_registry
 
280
 
 
281
 
 
282
def get_patched_registry(type_name, template_class):
 
283
    registry = _object_registry.copy()
 
284
    for base_uuid in registry.keys():
 
285
        if type_name in registry[base_uuid]:
 
286
            registry[base_uuid][type_name] = template_class
 
287
    return registry