manageiq-postgres_ha_admin 3.0.1 → 3.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 69058e26d2972bfc1d80272447fccb3c2c7f489d
4
- data.tar.gz: 3361d3e280fbb91f4e62aaca639816a8d40b4a77
3
+ metadata.gz: f50d41a74e240ed1a10dca38f98344db417f893e
4
+ data.tar.gz: 000fb72ae8791829c5952e30a4d5592212579dba
5
5
  SHA512:
6
- metadata.gz: 466386de6374dc0f02100d1641ee5b0ce82f8a42ecc0d15ad1de5e1a492192c0f34c2d5b02fbc0e5a256d5d5ea0171a1915d8fad3e5faea7ccd7f69678a53531
7
- data.tar.gz: 2c304a3e5452f00dc28bce7733e9c1f80e8679a781afe7729a7f0b1daca4acec41a63984880b8dc4ef64c8338f0dd91ca360dcb39e85bb76d3831a0f460d36e0
6
+ metadata.gz: ae47a98470967dd5edb5d376951b9c80e0c07d00c097fca2661565bcb6fd05805c68e1acad30643f025302a9c08e0893be4d0604d27829fd9b62dfa9daca2612
7
+ data.tar.gz: abd3bfa324f48627a36518ff6a09f4ae74da2ae8c0395ad17036554bb62d28487446d5089d9987574af86acd7b104e662d1365a695a0e93f39bb0bd38cd825e2
data/CHANGELOG.md CHANGED
@@ -3,6 +3,11 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  This project adheres to [Semantic Versioning](http://semver.org/).
5
5
 
6
+ ## [3.1.0] - 2019-05-09
7
+
8
+ ### Added
9
+ - Add a logical replication config handler [#17](https://github.com/ManageIQ/manageiq-postgres_ha_admin/pull/17)
10
+
6
11
  ## [3.0.1] - 2019-03-19
7
12
 
8
13
  ### Changed
data/Gemfile CHANGED
@@ -2,6 +2,3 @@ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in manageiq-smartstate.gemspec
4
4
  gemspec
5
-
6
- # For util/postgres_admin
7
- gem "manageiq-gems-pending", :git => "https://github.com/ManageIQ/manageiq-gems-pending", :branch => "master"
@@ -9,6 +9,7 @@ require 'manageiq/postgres_ha_admin/failover_monitor'
9
9
  require 'manageiq/postgres_ha_admin/config_handler'
10
10
  require 'manageiq/postgres_ha_admin/config_handler/rails_config_handler'
11
11
  require 'manageiq/postgres_ha_admin/config_handler/pglogical_config_handler'
12
+ require 'manageiq/postgres_ha_admin/config_handler/logical_replication_config_handler'
12
13
 
13
14
  module ManageIQ
14
15
  module PostgresHaAdmin
@@ -0,0 +1,34 @@
1
+ require 'pg'
2
+ require 'pg/dsn_parser'
3
+
4
+ module ManageIQ
5
+ module PostgresHaAdmin
6
+ class LogicalReplicationConfigHandler < ConfigHandler
7
+ attr_reader :subscription, :conn_info
8
+
9
+ def initialize(options = {})
10
+ @subscription = options[:subscription]
11
+ @conn_info = options[:conn_info]
12
+ end
13
+
14
+ def name
15
+ "Logical Replication subscription #{subscription} Config Handler"
16
+ end
17
+
18
+ def read
19
+ conn = PG::Connection.open(@conn_info)
20
+ dsn = conn.exec_params(<<~SQL, [@subscription]).first["subconninfo"]
21
+ SELECT subconninfo
22
+ FROM pg_subscription
23
+ WHERE subname = $1
24
+ SQL
25
+ PG::DSNParser.new.parse(dsn)
26
+ end
27
+
28
+ def write(_params)
29
+ # Nothing to do here as the expectation is that the user will
30
+ # remove and re-add the subscription in the after failover callback
31
+ end
32
+ end
33
+ end
34
+ end
@@ -1,5 +1,5 @@
1
1
  module ManageIQ
2
2
  module PostgresHaAdmin
3
- VERSION = '3.0.1'.freeze
3
+ VERSION = '3.1.0'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: manageiq-postgres_ha_admin
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.1
4
+ version: 3.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ManageIQ Developers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-03-19 00:00:00.000000000 Z
11
+ date: 2019-05-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: awesome_spawn
@@ -185,6 +185,7 @@ files:
185
185
  - Rakefile
186
186
  - lib/manageiq-postgres_ha_admin.rb
187
187
  - lib/manageiq/postgres_ha_admin/config_handler.rb
188
+ - lib/manageiq/postgres_ha_admin/config_handler/logical_replication_config_handler.rb
188
189
  - lib/manageiq/postgres_ha_admin/config_handler/pglogical_config_handler.rb
189
190
  - lib/manageiq/postgres_ha_admin/config_handler/rails_config_handler.rb
190
191
  - lib/manageiq/postgres_ha_admin/failover_monitor.rb