Skip to content

Commit 8295b48

Browse files
author
Morgan Haskel
committed
Revert "(MODULES-661) Add host parameter to psql commands"
This reverts commit d92b254. Conflicts: spec/unit/puppet/provider/postgresql_psql/ruby_spec.rb
1 parent 62a774a commit 8295b48

File tree

5 files changed

+2
-65
lines changed

5 files changed

+2
-65
lines changed

lib/puppet/provider/postgresql_psql/ruby.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ def run_sql_command(sql)
1414
command = [resource[:psql_path]]
1515
command.push("-d", resource[:db]) if resource[:db]
1616
command.push("-p", resource[:port]) if resource[:port]
17-
command.push("-h", resource[:host]) if resource[:host]
1817
command.push("-t", "-c", sql)
1918

2019
if resource[:cwd]

lib/puppet/type/postgresql_psql.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,6 @@ def matches(value)
5252
desc "The name of the database to execute the SQL command against."
5353
end
5454

55-
newparam(:host) do
56-
desc "The host to run the PSQL against"
57-
end
58-
5955
newparam(:port) do
6056
desc "The port of the database server to execute the SQL command against."
6157
end

spec/acceptance/alternative_host_spec.rb

Lines changed: 0 additions & 44 deletions
This file was deleted.

spec/unit/puppet/provider/postgresql_psql/ruby_spec.rb

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -79,19 +79,6 @@
7979
provider.run_sql_command("SELECT something")
8080
end
8181
end
82-
describe "with host string" do
83-
let(:attributes) do { :host => '127.0.0.1' } end
84-
85-
it "executes with the given host" do
86-
expect(provider).to receive(:run_command).with(["psql",
87-
"-h", "127.0.0.1",
88-
"-t", "-c",
89-
"SELECT something"],
90-
"postgres", "postgres")
91-
92-
provider.run_sql_command("SELECT something")
93-
end
94-
end
9582

9683
context("#run_unless_sql_command") do
9784
let(:attributes) do { } end

spec/unit/puppet/type/postgresql_psql_spec.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
require 'spec_helper'
22

33
describe Puppet::Type.type(:postgresql_psql), "when validating attributes" do
4-
[:name, :unless, :db, :psql_path, :psql_user, :psql_group, :host].each do |attr|
4+
[:name, :unless, :db, :psql_path, :psql_user, :psql_group].each do |attr|
55
it "should have a #{attr} parameter" do
66
expect(Puppet::Type.type(:postgresql_psql).attrtype(attr)).to eq(:param)
77
end
@@ -30,8 +30,7 @@
3030
:psql_group => "postgres",
3131
:cwd => "/var/lib",
3232
:refreshonly => :true,
33-
:search_path => [ "schema1", "schema2"],
34-
:host => 'postgres-db-server',
33+
:search_path => [ "schema1", "schema2"]
3534
}.each do |attr, value|
3635
context attr do
3736
let(:attributes) do { attr => value } end

0 commit comments

Comments
 (0)