def test_end_to_end():
    with splice_extension_in("test_module_path"):
        ibl = InmantaBootloader()

        config.server_enabled_extensions.set("testplugin")

        ctx = ibl.load_slices()
        byname = {sl.name: sl for sl in ctx.get_slices()}
        assert "testplugin.testslice" in byname
Пример #2
0
def print_versions_installed_components_and_exit() -> None:
    bootloader = InmantaBootloader()
    app_context = bootloader.load_slices()
    product_metadata = app_context.get_product_metadata()
    extension_statuses = app_context.get_extension_statuses()
    if product_metadata.version:
        print(f"{product_metadata.product} ({product_metadata.edition}): {product_metadata.version}")
    else:
        print(f"{product_metadata.product} ({product_metadata.edition}): version unknown")
    print(f"Compiler version: {get_compiler_version()}")
    if extension_statuses:
        print("Extensions:")
        for ext_status in extension_statuses:
            print(f"    * {ext_status.name}: {ext_status.version}")
    else:
        print("Extensions: No extensions found")
    sys.exit(0)
Пример #3
0
def get_product_meta_data() -> ProductMetadata:
    """Get the produce meta-data"""
    bootloader = InmantaBootloader()
    context = bootloader.load_slices()
    return context.get_product_metadata()