Project

General

Profile

Feature #234 ยป debian_preseed.patch

Jochen Schalanda, 05/03/2010 11:29 AM

View differences:

lib/family.rb
# Adds operatingsystem family behaviour to the Operatingsystem class
# The variant is calculated at run-time
require 'ostruct'
require 'uri'
module Family
# NEVER, EVER reorder this list. Additions are allowed but offsets are encoded in the database
FAMILIES = [:Debian, :RedHat, :Solaris]
......
include Family
def preseed_server media
media.path.match('^(\w+):\/\/((\w|\.)+)((\w|\/)+)$')[2]
URI.parse(media.path).normalize.select(:host, :port).compact.join(':')
end
#TODO: rethink of a more generic way
def preseed_path media
media.path.match('^(\w+):\/\/((\w|\.)+)((\w|\/)+)$')[4]
URI.parse(media.path).normalize.select(:path, :query).compact.join('?')
end
end
    (1-1/1)