whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ru...@apache.org
Subject [whimsy] branch master updated: allow vhosttest and mkconf to be used together
Date Thu, 05 Oct 2017 14:29:39 GMT
This is an automated email from the ASF dual-hosted git repository.

rubys 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 89c0520  allow vhosttest and mkconf to be used together
89c0520 is described below

commit 89c0520831546f7c19ce9e22ab0ac12fd706730b
Author: Sam Ruby <rubys@intertwingly.net>
AuthorDate: Thu Oct 5 10:29:26 2017 -0400

    allow vhosttest and mkconf to be used together
---
 tools/mkconf.rb    | 13 ++++++++++---
 tools/vhosttest.rb |  2 +-
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/tools/mkconf.rb b/tools/mkconf.rb
index 52784a1..b679ef7 100644
--- a/tools/mkconf.rb
+++ b/tools/mkconf.rb
@@ -1,16 +1,23 @@
 #
 # Generate a whimsy.local version of the deployed whimsy configuration
 #
+# Example usage:
+#  ruby vhosttest.rb | ruby mkconf.rb /private/etc/apache2/other/whimsy.conf
+#
 
 require 'rbconfig'
 
-conf = `ssh whimsy-vm4.apache.org cat \
-  /etc/apache2/sites-enabled/*-whimsy-vm-443.conf`
+if STDIN.tty?
+  conf = `ssh whimsy-vm4.apache.org cat \
+    /etc/apache2/sites-enabled/*-whimsy-vm-443.conf`
+else
+  conf = STDIN.read
+end
 
 conf.sub! 'VirtualHost *:443', 'VirtualHost *:80'
 conf.sub! 'ServerName whimsy.apache.org', 'ServerName whimsy.local'
 
-conf.gsub! /\n\s*RemoteIPHeader.*/, ''
+conf.gsub! /(\A|\n)\s*RemoteIPHeader.*/, ''
 
 conf.gsub! /\n\s*PassengerDefault.*/, ''
 
diff --git a/tools/vhosttest.rb b/tools/vhosttest.rb
index 62adbcf..a45f16a 100644
--- a/tools/vhosttest.rb
+++ b/tools/vhosttest.rb
@@ -20,7 +20,7 @@ end
 require 'yaml'
 require "#{IP}/modules/vhosts_whimsy/lib/puppet/parser/functions/preprocess_vhosts.rb"
 
-facts = YAML.load_file("#{IP}//data/nodes/whimsy.apache.org.yaml")
+facts = YAML.load_file("#{IP}/data/nodes/whimsy-vm4.apache.org.yaml")
 facts = facts['vhosts_whimsy::vhosts::vhosts']['whimsy-vm-443']
 ldap = ASF::LDAP.hosts.sort.first
 

-- 
To stop receiving notification emails like this one, please contact
['"commits@whimsical.apache.org" <commits@whimsical.apache.org>'].

Mime
View raw message