manageiq-appliance_console 1.2.3 → 1.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5db0f0a200a6f3e1875eb8b7545ae1489f7eea32fe2c4d8d649eefdd29d8a3fe
4
- data.tar.gz: a7300234642869da3c81a4dc83ed5f12d7a6978807adbc01f0efea04898d2a75
3
+ metadata.gz: 03acccd11ea06ed06a200676e668a38951e56cdd2d65a2cfdfff7f7f8c54744b
4
+ data.tar.gz: 3da4c72c3a719f016fca4aced7062b9c1efd3d88a5662b2a1807f3670843f4ec
5
5
  SHA512:
6
- metadata.gz: abbe0a3d8746474b4f38663ad01bb2dfec45c8f8f8c02084ac63230c808985584c8bdcf37d04df9aa45d09ec4df8c7e75db68e94b739f2a7d2bedbf5989df6d8
7
- data.tar.gz: 0a0bad5e8ad7e3dd1c07a5d895fa118d10ad6834ac17be6518f8af1c0bf3fc6b1be3c9f728905df1a43e33d22316ed9cf1affbef138d37667cbadd8cbcbc3790
6
+ metadata.gz: faf9223abdcd01b9615d91cfe79f981adc492c208716e20dc6aea92f7a0bc6547468019502f62f8be8735f40bb2f35e2c4a3bca13061a2b5e403989daed15bf8
7
+ data.tar.gz: f2e1f78fd2d49a821d77560a197b2ae83d7c65504d64ca2b6fa137143afe856a27302332587dcbebd8e4a3e4714ab19624e95e4f2fffd3f0d48551ed6818e617
@@ -394,6 +394,14 @@ Static Network Configuration
394
394
  task_params = []
395
395
  uri = nil
396
396
 
397
+ connections = ManageIQ::ApplianceConsole::Utilities.db_connections - 1
398
+ if connections > 0
399
+ say("\nDatabase restore failed")
400
+ say("\nThere #{connections > 1 ? "are #{connections} connections" : "is 1 connection"} preventing a database restore")
401
+ press_any_key
402
+ raise MiqSignalError
403
+ end
404
+
397
405
  # TODO: merge into 1 prompt
398
406
  case ask_with_menu("Restore Database File", RESTORE_OPTIONS, RESTORE_LOCAL, nil)
399
407
  when RESTORE_LOCAL
@@ -435,10 +443,6 @@ Static Network Configuration
435
443
  if rake_success && delete_agreed
436
444
  say("\nRemoving the database restore file #{DB_RESTORE_FILE}...")
437
445
  File.delete(DB_RESTORE_FILE)
438
- elsif !rake_success
439
- say("\nDatabase restore failed")
440
- connections = ManageIQ::ApplianceConsole::Utilities.db_connections - 1
441
- say("\nThere #{connections > 1 ? "are #{connections} connections" : "is 1 connection"} preventing a database restore") if connections > 0
442
446
  end
443
447
  end
444
448
  press_any_key
@@ -67,6 +67,10 @@ module ApplianceConsole
67
67
  options[:timezone]
68
68
  end
69
69
 
70
+ def date_time?
71
+ options[:datetime]
72
+ end
73
+
70
74
  def extauth_opts?
71
75
  options[:extauth_opts]
72
76
  end
@@ -141,11 +145,12 @@ module ApplianceConsole
141
145
  opt :iparealm, "IPA Server realm (optional)", :type => :string
142
146
  opt :ca, "CA name used for certmonger", :type => :string, :default => "ipa"
143
147
  opt :timezone, "Time zone", :type => :string
148
+ opt :datetime, "Date and time, in YYYY-MM-DDTHH:MM:SS (ISO8601) format", :type => :string
144
149
  opt :postgres_client_cert, "install certs for postgres client", :type => :boolean
145
150
  opt :postgres_server_cert, "install certs for postgres server", :type => :boolean
146
151
  opt :http_cert, "install certs for http server", :type => :boolean
147
152
  opt :extauth_opts, "External Authentication Options", :type => :string
148
- opt :server, "Server status", :type => :string
153
+ opt :server, "{start|stop|restart} actions on evmserverd Server", :type => :string
149
154
  end
150
155
  Trollop.die :region, "needed when setting up a local database" if region_number_required? && options[:region].nil?
151
156
  self
@@ -158,8 +163,8 @@ module ApplianceConsole
158
163
  def run
159
164
  Trollop.educate unless set_host? || key? || database? || tmp_disk? || log_disk? ||
160
165
  uninstall_ipa? || install_ipa? || certs? || extauth_opts? ||
161
- time_zone? || set_server_state? || db_hourly_maintenance? ||
162
- set_replication?
166
+ time_zone? || date_time? || set_server_state? ||
167
+ db_hourly_maintenance? || set_replication?
163
168
  if set_host?
164
169
  system_hosts = LinuxAdmin::Hosts.new
165
170
  system_hosts.hostname = options[:host]
@@ -171,6 +176,7 @@ module ApplianceConsole
171
176
  set_db if database?
172
177
  set_replication if set_replication?
173
178
  set_time_zone if time_zone?
179
+ set_date_time if date_time?
174
180
  config_db_hourly_maintenance if db_hourly_maintenance?
175
181
  config_tmp_disk if tmp_disk?
176
182
  config_log_disk if log_disk?
@@ -280,6 +286,26 @@ module ApplianceConsole
280
286
  end
281
287
  end
282
288
 
289
+ def set_date_time
290
+ date_time_config = ManageIQ::ApplianceConsole::DateTimeConfiguration.new
291
+ unless options[:datetime] == "auto"
292
+ date_time_config.manual_time_sync = true
293
+ date_time_config.new_date, date_time_config.new_time = options[:datetime].split("T")
294
+ return unless date_time_valid?(date_time_config)
295
+ end
296
+ date_time_config.activate
297
+ end
298
+
299
+ def date_time_valid?(date_time_config)
300
+ unless ManageIQ::ApplianceConsole::DateTimeConfiguration::DATE_REGEXP =~ date_time_config.new_date &&
301
+ ManageIQ::ApplianceConsole::DateTimeConfiguration::TIME_REGEXP =~ date_time_config.new_time
302
+ say("Datetime should be given in YYYY-MM-DDTHH:MM:SS format")
303
+ say("Datetime not configured")
304
+ return false
305
+ end
306
+ true
307
+ end
308
+
283
309
  def key_configuration
284
310
  @key_configuration ||= KeyConfiguration.new(
285
311
  :action => options[:fetch_key] ? :fetch : :create,
@@ -1,5 +1,5 @@
1
1
  module ManageIQ
2
2
  module ApplianceConsole
3
- VERSION = '1.2.3'.freeze
3
+ VERSION = '1.2.4'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: manageiq-appliance_console
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.3
4
+ version: 1.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - ManageIQ Developers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-01-04 00:00:00.000000000 Z
11
+ date: 2018-01-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord