openshift/origin-server — pull request #1114 by Miciah (2013-01-03 00:36:39+00:00)
Title: Replace hard-coded cartridge types with categories

Currently, the type of a cartridge ("standalone" or "embedded") is
hard-coded using the FRAMEWORK_CART_NAMES constant. Prior to this commit,
this constant has been kept in CartridgeCache.cartridge_names, along with
the logic to filter queries by cartridge type.

This commit removes FRAMEWORK_CART_NAMES and changes
CartridgeCache.cartridge_names to use the cartridge's categories to filter
results. If cartridge_names is passed 'standalone', it now selects
cartridges that are included in the 'web_framework' category. (Already,
all 'standalone' cartridges are marked with the 'web_framework' category.)
If it is passed nil, it selects all cartridges. Thus the method should
behave the same as it did previously in existing usage.

This change is necessary in order to facilitate the creation of custom
standalone cartridges. Without this change, cartridge authors would need
to modify FRAMEWORK_CART_NAMES, in the OpenShift code. With this change,
cartridge authors need merely add 'web_framework' to the list of categories
in the manifest.yml files of standalone cartridges.