private void populateExtensionInfo() {
    extensionInfo.setName(extensionDirectory.getExtensionDirName());
    extensionInfo.setVersion(extensionDirectory.getName());

    id = String.format("%s:%s", extensionInfo.getName(), extensionInfo.getVersion());

    LOG.debug("Adding new extension to known extensions, extensionName = {}, extensionVersion = {}", extensionInfo.getName(), extensionInfo.getVersion());


    //todo: give additional thought on handling missing metainfo.xml
    ExtensionMetainfoXml emx = extensionDirectory.getMetaInfoFile();
    if (emx != null) {
      if (!emx.isValid()) {
        extensionInfo.setValid(false);
        extensionInfo.addErrors(emx.getErrors());
      }
      extensionInfo.setParentExtensionVersion(emx.getExtends());
      extensionInfo.setStacks(emx.getStacks());
      extensionInfo.setExtensions(emx.getExtensions());
      extensionInfo.setActive(emx.getVersion().isActive());
      extensionInfo.setAutoLink(emx.isAutoLink());
    }

    try {
      // Read the service for this extension
      populateServices();
      if (!extensionInfo.isValid()) {
        setValid(false);
        addErrors(extensionInfo.getErrors());
      }

      //todo: shouldn't blindly catch Exception, re-evaluate this.
    } catch (Exception e) {
      String error = "Exception caught while populating services for extension: " +
          extensionInfo.getName() + "-" + extensionInfo.getVersion();
      setValid(false);
      extensionInfo.setValid(false);
      addError(error);
      extensionInfo.addError(error);
      LOG.error(error);
    }
  }
Populate the extension module and info from the extension definition.
ambari-server/src/main/java/org/apache/ambari/server/stack/ExtensionModule.java