def read_definitions(definition, content_type = nil)
      @appliance_parser.load_schemas
      if File.exists?(definition)
        definition_file_extension = File.extname(definition)

        appliance_config =
            case definition_file_extension
              when '.appl', '.yml', '.yaml'
                @appliance_parser.parse_definition(definition)
              else
                unless content_type.nil?
                  case content_type
                    when 'application/x-yaml', 'text/yaml'
                      @appliance_parser.parse_definition(definition)
                  end
                end
            end

        return if appliance_config.nil?

        @appliance_configs << appliance_config
        appliances = []

        @appliance_configs.each { |config| appliances << config.name }

        appliance_config.appliances.reverse.each do |appliance_name|
          read_definitions("#{File.dirname(definition)}/#{appliance_name}#{definition_file_extension}") unless appliances.include?(appliance_name)
        end unless appliance_config.appliances.nil? or !appliance_config.appliances.is_a?(Array)
      else
        # Assuming that the definition is provided as string
        @appliance_configs << @appliance_parser.parse_definition(definition, false)
      end
    end
def read_definitions(definition, content_type = nil)
      @appliance_parser.load_schemas
      if File.exists?(definition)
        definition_file_extension = File.extname(definition)

        appliance_config =
            case definition_file_extension
              when '.appl', '.yml', '.yaml'
                @appliance_parser.parse_definition(definition)
              else
                unless content_type.nil?
                  case content_type
                    when 'application/x-yaml', 'text/yaml'
                      @appliance_parser.parse_definition(definition)
                  end
                end
            end

        return if appliance_config.nil?

        @appliance_configs << appliance_config
        appliances = []

        @appliance_configs.each { |config| appliances << config.name }

        appliance_config.appliances.reverse.each do |appliance_name|
          read_definitions("#{File.dirname(definition)}/#{appliance_name}#{definition_file_extension}") unless appliances.include?(appliance_name)
        end unless appliance_config.appliances.nil? or !appliance_config.appliances.is_a?(Array)
      else
        # Assuming that the definition is provided as string
        @appliance_configs << @appliance_parser.parse_definition(definition, false)
      end
    end
Reads definition provided as string. This string can be a YAML document. In this case
 definition is parsed and an ApplianceConfig object is returned. In other cases it tries to search
 for a file with provided name.