manageiq-appliance_console 3.0.0 → 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
  SHA256:
3
- metadata.gz: 5d7e378f02630aa568cd8ff477da4a1e492421119f5c964e8c5093ace832a501
4
- data.tar.gz: c6ad984e153ef15639aa0f23bef9dfb9aad6e3dc448f2ce05263670499c98b2c
3
+ metadata.gz: 321a59af1bedf7724c6a91de23b21d132f721cc368a514035ff04fc137fa4736
4
+ data.tar.gz: '04968551c5da4d87cc95696b4a608babc6f588b9eb14a3524b2d4791a20020ef'
5
5
  SHA512:
6
- metadata.gz: 21756d451a2359bcbee0085dc816383ec2e3d5dab9f49111976d838ab4a42d0f0a80a2c36ae9ebadeb98805c4a7955516014a763dc293f6262c84e7327969e49
7
- data.tar.gz: 51b11f3030dd224fc9cc4ebba9eb4d3fe16148f340d63452f24a5943579e0ea4f5515be482f3026ca2f46e77f1ba07749116a55da1483c26aef40c28519f6a3e
6
+ metadata.gz: 157cd575271810d91800e6ca1b2e7c6ef4194d7ec7bc750a40f311c1917ed526a23d8488fe8785da70605765e844b0894e019f3558b1a7138ab1ce91c222a7c9
7
+ data.tar.gz: 85220ed73c634509697d25020b6f9023dd0f3c1524ec05d5bca79c9e27866b5b220c0d5f4be5b451682fcbe04ea2dd73965cebb009e34d07dd91a3e415d21940
@@ -42,12 +42,12 @@ def ensure_key_configured
42
42
  else
43
43
  say("\nEncryption key not configured.")
44
44
  press_any_key
45
- raise MiqSignalError
45
+ raise ManageIQ::ApplianceConsole::MiqSignalError
46
46
  end
47
47
  end
48
48
  end
49
49
 
50
- [:INT, :TERM, :ABRT, :TSTP].each { |s| trap(s) { raise MiqSignalError } }
50
+ [:INT, :TERM, :ABRT, :TSTP].each { |s| trap(s) { raise ManageIQ::ApplianceConsole::MiqSignalError } }
51
51
 
52
52
  VERSION_FILE = ManageIQ::ApplianceConsole::RAILS_ROOT.join("VERSION")
53
53
  LOGFILE = ManageIQ::ApplianceConsole::RAILS_ROOT.join("log", "appliance_console.log")
@@ -8,7 +8,8 @@ module ManageIQ
8
8
  LOCAL_FILE = "Local file".freeze
9
9
  NFS_FILE = "Network File System (NFS)".freeze
10
10
  SMB_FILE = "Samba (SMB)".freeze
11
- FILE_OPTIONS = [LOCAL_FILE, NFS_FILE, SMB_FILE, CANCEL].freeze
11
+ S3_FILE = "Amazon S3 (S3)".freeze
12
+ FILE_OPTIONS = [LOCAL_FILE, NFS_FILE, SMB_FILE, S3_FILE, CANCEL].freeze
12
13
 
13
14
  DB_RESTORE_FILE = "/tmp/evm_db.backup".freeze
14
15
  DB_DEFAULT_DUMP_FILE = "/tmp/evm_db.dump".freeze
@@ -56,6 +57,7 @@ module ManageIQ
56
57
  when LOCAL_FILE then ask_local_file_options
57
58
  when NFS_FILE then ask_nfs_file_options
58
59
  when SMB_FILE then ask_smb_file_options
60
+ when S3_FILE then ask_s3_file_options
59
61
  when CANCEL then raise MiqSignalError
60
62
  end
61
63
  end
@@ -94,6 +96,29 @@ module ManageIQ
94
96
  @task_params = ["--", params]
95
97
  end
96
98
 
99
+ def ask_s3_file_options
100
+ access_key_prompt = <<-PROMPT.strip_heredoc.chomp
101
+ Access Key ID with access to this file.
102
+ Example: 'amazon_aws_user'
103
+ PROMPT
104
+
105
+ @uri = ask_for_uri(*remote_file_prompt_args_for("s3"))
106
+ user = just_ask(access_key_prompt)
107
+ pass = ask_for_password("Secret Access Key for #{user}")
108
+ region = just_ask("Amazon Region for database file", "us-east-1")
109
+
110
+ @task = "evm:db:#{action}:remote"
111
+ @task_params = [
112
+ "--",
113
+ {
114
+ :uri => uri,
115
+ :uri_username => user,
116
+ :uri_password => pass,
117
+ :aws_region => region
118
+ }
119
+ ]
120
+ end
121
+
97
122
  def ask_to_delete_backup_after_restore
98
123
  if action == :restore && backup_type == LOCAL_FILE
99
124
  say("The local database restore file is located at: '#{uri}'.\n")
@@ -269,6 +269,7 @@ FRIENDLY
269
269
 
270
270
  def validate_encryption_key!
271
271
  raise "Encryption key invalid" unless ManageIQ::ApplianceConsole::Utilities.rake("evm:validate_encryption_key", {})
272
+ true
272
273
  end
273
274
 
274
275
  def do_save(settings)
@@ -1,4 +1,5 @@
1
1
  require 'resolv'
2
+ require 'io/console'
2
3
 
3
4
  module ManageIQ
4
5
  module ApplianceConsole
@@ -17,6 +18,7 @@ module ApplianceConsole
17
18
  SAMPLE_URLS = {
18
19
  'nfs' => 'nfs://host.mydomain.com/exported/my_exported_folder/db.backup',
19
20
  'smb' => 'smb://host.mydomain.com/my_share/daily_backup/db.backup',
21
+ 's3' => 's3://mybucket/my_subdirectory/daily_backup/db.backup',
20
22
  }
21
23
 
22
24
  def sample_url(scheme)
@@ -41,12 +43,7 @@ module ApplianceConsole
41
43
 
42
44
  def press_any_key
43
45
  say("\nPress any key to continue.")
44
- begin
45
- system("stty raw -echo")
46
- STDIN.getc
47
- ensure
48
- system("stty -raw echo")
49
- end
46
+ STDIN.noecho(&:getc)
50
47
  end
51
48
 
52
49
  def clear_screen
@@ -1,5 +1,5 @@
1
1
  module ManageIQ
2
2
  module ApplianceConsole
3
- VERSION = '3.0.0'.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-appliance_console
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
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: 2018-08-01 00:00:00.000000000 Z
11
+ date: 2018-08-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord