9e0edabed4
Due to using an undefined variable when determining the server id, the client manifest was writing an incorrectly formatted zanata.ini file. Furthermore, the intent of the change did not go far enough, since it would not strip off the URI scheme or port. Due to the complexities of parsing URIs in regular expressions, use a Puppet function for the heavy lifting. Change-Id: I754ee54f805c91f5548b2cf270b23c68eed3959c
11 lines
211 B
Ruby
11 lines
211 B
Ruby
require 'uri'
|
|
|
|
module Puppet::Parser::Functions
|
|
newfunction(:parse_server_id, :type => :rvalue) do |args|
|
|
uri = URI.parse(args[0])
|
|
unless uri.host.nil?
|
|
uri.host.gsub(/\./, '_')
|
|
end
|
|
end
|
|
end
|