Yair Zaslavsky has posted comments on this change. Change subject: aaa: Change builtin authenticators and directories initialization ......................................................................
Patch Set 8: (5 comments) http://gerrit.ovirt.org/#/c/25741/8/backend/manager/modules/extensions-manager/src/main/java/org/ovirt/engine/core/extensions/mgr/ExtensionsManager.java File backend/manager/modules/extensions-manager/src/main/java/org/ovirt/engine/core/extensions/mgr/ExtensionsManager.java: Line 161: ExtensionEntry entry = new ExtensionEntry(props, confFile); Line 162: ExtensionEntry alreadyLoadedEntry = loadedEntries.get(entry.getName()); Line 163: if (alreadyLoadedEntry != null) { Line 164: throw new ConfigurationException(String.format( Line 165: "Could not load the configuration '%1$s' from file %2$s. A configuration with the same name was already loaded from file %3$s", > add name of the already loaded as file maybe null not sure i follow. the name of the extension is already logged - it's the first argument. this exception is thrown only if we encountered another configuration with the same name. Line 166: entry.getName(), Line 167: getFileName(entry.file), Line 168: getFileName(alreadyLoadedEntry.file)) Line 169: ); Line 180: ).newInstance(); Line 181: entry.extension.setContext(entry.context); Line 182: entry.extension.init(); Line 183: activatedEntries.put(entry.getName(), entry); Line 184: MultiValueMapUtils.addToMap(entry.getProvides(), entry, providesEntries); > add entry.enabled = true here why? the entry might be turned off by the configuration or by the engine configuration file. Line 185: } catch (Exception ex) { Line 186: entry.enabled = false; Line 187: log.error( Line 188: String.format( Line 182: entry.extension.init(); Line 183: activatedEntries.put(entry.getName(), entry); Line 184: MultiValueMapUtils.addToMap(entry.getProvides(), entry, providesEntries); Line 185: } catch (Exception ex) { Line 186: entry.enabled = false; > remove this^ ExtensionEntry CTOR populates the "enabled" field from the configuration of the extension. it can be set to true. This is why I set here the enabled flag to false - in case of exception, it should be turned off. I can extract filling the enabled flag outside the CTOR, I'm not sure this will look nice at the code + if the CTOR of ExtensionEntry reads the configuration, IMHO it should read the enabled entry from the configuration, and set the value accordingly. Line 187: log.error( Line 188: String.format( Line 189: "Error in activating extension %1$s. Exception message is %2$s", Line 190: entry.getName(), Line 198: } Line 199: } Line 200: Line 201: private String getFileName(File file) { Line 202: return file != null ? file.getAbsolutePath() : "null"; > if you do this, better put N/A :) Done Line 203: } Line 204: Line 205: private Module loadModule(String moduleSpec) { Line 206: // If the module was not already loaded, load it Line 253: emptyIfNull(context.get(ExtensionProperties.VERSION)), Line 254: emptyIfNull(context.get(ExtensionProperties.LICENSE)), Line 255: emptyIfNull(context.get(ExtensionProperties.HOME)), Line 256: emptyIfNull(context.get(ExtensionProperties.AUTHOR)), Line 257: emptyIfNull(entry.file) > getFileName? Done Line 258: ) Line 259: ); Line 260: } Line 261: } -- To view, visit http://gerrit.ovirt.org/25741 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id8513cb992c5becef7e83c04a8da8bc7f1622348 Gerrit-PatchSet: 8 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Yair Zaslavsky <yzasl...@redhat.com> Gerrit-Reviewer: Alon Bar-Lev <alo...@redhat.com> Gerrit-Reviewer: Yair Zaslavsky <yzasl...@redhat.com> Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches