You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by se...@apache.org on 2019/12/10 23:31:50 UTC

[whimsy] branch master updated: Allow user to provide alternate local repo checkout

This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git


The following commit(s) were added to refs/heads/master by this push:
     new a06e079  Allow user to provide alternate local repo checkout
a06e079 is described below

commit a06e0798ffd9216ef906f2767f78bef843480b38
Author: Sebb <se...@apache.org>
AuthorDate: Tue Dec 10 23:31:38 2019 +0000

    Allow user to provide alternate local repo checkout
---
 tools/vhosttest.rb | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/tools/vhosttest.rb b/tools/vhosttest.rb
old mode 100644
new mode 100755
index 251435b..4f22c94
--- a/tools/vhosttest.rb
+++ b/tools/vhosttest.rb
@@ -1,3 +1,5 @@
+#!/usr/bin/env ruby
+
 #
 # Scaffolding needed to test infrastructure-puppet/modules/vhosts_whimsy/...
 # preprocess_vhosts.rb puppet macro
@@ -6,7 +8,8 @@
 $LOAD_PATH.unshift '/srv/whimsy/lib'
 require 'whimsy/asf'
 
-IP = ASF::Git['infrastructure-puppet']
+# Allow override of local repo
+IP = ARGV.shift || ASF::Git['infrastructure-puppet']
 
 module Puppet
   module Parser
@@ -23,7 +26,7 @@ require "#{IP}/modules/vhosts_whimsy/lib/puppet/parser/functions/preprocess_vhos
 yaml = Dir["#{IP}/data/nodes/whimsy-vm*.apache.org.yaml"].
   sort_by {|path| path[/-vm(\d+)/, 1].to_i}.last
 facts = YAML.load_file(yaml)['vhosts_whimsy::vhosts::vhosts']['whimsy-vm-443']
-ldap = ASF::LDAP.hosts.sort.first
+ldap = ASF::LDAP::RO_HOSTS.join(' ') # to be closer to live site
 
 macros = Puppet::Parser::Functions::ApacheVHostMacros.new(facts, ldap)
 puts macros.result['custom_fragment']