Skip to content

Commit 5f7caec

Browse files
(MAINT) Remove extraneous logic from spec
This commit removes logic from the features file in the acceptance tests suite which existed only to support Puppet 3. This logic is no longer needed as Puppet 3 is no longer supported. Additionally, the way the logic was written caused the tests designed for Puppet 3 to run against Puppet 5. This commit simplifies the maintenance and execution of the suite of acceptance tests.
1 parent 377a0bb commit 5f7caec

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

spec/acceptance/z_last_sqlserver_features_spec.rb

+2-11
Original file line numberDiff line numberDiff line change
@@ -204,17 +204,8 @@ def bind_and_apply_failing_manifest(features, ensure_val = 'present')
204204

205205
before(:all) do
206206
puppet_version = (on host, puppet('--version')).stdout.chomp
207-
208-
if puppet_version =~ /^4\.\d+\.\d+/
209-
json_result = JSON.parse((on host, puppet('facts --render-as json')).raw_output)["values"]["sqlserver_instances"]
210-
names = json_result.collect { |k, v| json_result[k].keys }.flatten
211-
else
212-
# use agents fact to get instance names
213-
distmoduledir = on(host, "echo #{host['distmoduledir']}").raw_output.chomp
214-
facter_opts = {:environment => {'FACTERLIB' => "#{distmoduledir}/sqlserver/lib/facter"}}
215-
216-
names = eval(fact_on(host, 'sqlserver_instances', facter_opts)).values.inject(:merge).keys
217-
end
207+
json_result = JSON.parse((on host, puppet('facts --render-as json')).raw_output)["values"]["sqlserver_instances"]
208+
names = json_result.collect { |k, v| json_result[k].keys }.flatten
218209
remove_sql_instances(host, {:version => sql_version, :instance_names => names})
219210
end
220211

0 commit comments

Comments
 (0)