Please review pull request #146: (#12665) allow dist dir and version file to be overridden by env vars opened by (justinstoller)
Description:
Previously the paths to the look up the pe version file were hard coded into the harness.
Barring a more substantial change to the the configuration of the harness using environmental variables is the best route I believe for configuring this kind of thing.
This changes the path to default to '/opt/enterprise/dist/LATEST' but can be overridden by exporting pe_dist_dir and a pe_version_file variables.
Tested against '/opt/enterprise/dists/LATEST' (default) and '/opt/enterprise/test/BLAH'.
- Opened: Wed Feb 15 20:23:43 UTC 2012
- Based on: puppetlabs:master (b478e4c11ed70b7dcd5531f275bf182aaa0a27f1)
- Requested merge: justinstoller:bug/master/12665-dont_hard_code_paths (f78adf6b562ab7a5656794dc7e042c9693d8a11c)
Diff follows:
diff --git a/lib/test_config.rb b/lib/test_config.rb
index aa86edc..a6552e1 100644
--- a/lib/test_config.rb
+++ b/lib/test_config.rb
@@ -32,9 +32,11 @@ def self.is_pe?
end
def self.load_pe_version
- version=""
+ dist_dir = ENV['pe_dist_dir'] || '/opt/enterprise/dists'
+ version_file = ENV['pe_version_file'] || 'LATEST'
+ version = ""
begin
- File.open("/opt/enterprise/dists/LATEST") do |file|
+ File.open("#{dist_dir}/#{version_file}") do |file|
while line = file.gets
if /(\w.*)/ =~ line then
version=$1
-- You received this message because you are subscribed to the Google Groups "Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to [email protected].
For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en.
