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 +4 -4
- data/bin/appliance_console +2 -2
- data/lib/manageiq/appliance_console/database_admin.rb +26 -1
- data/lib/manageiq/appliance_console/database_configuration.rb +1 -0
- data/lib/manageiq/appliance_console/prompts.rb +3 -6
- data/lib/manageiq/appliance_console/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 321a59af1bedf7724c6a91de23b21d132f721cc368a514035ff04fc137fa4736
|
4
|
+
data.tar.gz: '04968551c5da4d87cc95696b4a608babc6f588b9eb14a3524b2d4791a20020ef'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 157cd575271810d91800e6ca1b2e7c6ef4194d7ec7bc750a40f311c1917ed526a23d8488fe8785da70605765e844b0894e019f3558b1a7138ab1ce91c222a7c9
|
7
|
+
data.tar.gz: 85220ed73c634509697d25020b6f9023dd0f3c1524ec05d5bca79c9e27866b5b220c0d5f4be5b451682fcbe04ea2dd73965cebb009e34d07dd91a3e415d21940
|
data/bin/appliance_console
CHANGED
@@ -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
|
-
|
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")
|
@@ -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
|
-
|
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
|
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.
|
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-
|
11
|
+
date: 2018-08-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|