opsmgr 0.34.6 → 0.34.7
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 +4 -4
- data/lib/opsmgr/api/client.rb +9 -0
- data/lib/opsmgr/api/http_client.rb +7 -0
- data/lib/opsmgr/api/version20/endpoints.rb +4 -0
- data/lib/opsmgr/cmd/bosh_command.rb +13 -23
- data/lib/opsmgr/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e4bb25a8258c39d67773e4fdd543df2d6d2b74e9
|
4
|
+
data.tar.gz: f1ca37b482308adfeb7373737dde9d1c8020f1b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 28bfe4c5f2598db439b64b3b0804de51fe5366274c450d4e6f5deb11df75506b72601ff0c89c036d822d8a4db2150163a89061a50e45c24df24510e1322abdf7
|
7
|
+
data.tar.gz: e5781a414abd95de90c577d9e11c7c9ef26404ff8ec6e16327cb66675fc512a97cb17f3f536a3e670fbe6217d287920069a357df12063751f5909a004f6b1851
|
data/lib/opsmgr/api/client.rb
CHANGED
@@ -36,6 +36,15 @@ module Opsmgr
|
|
36
36
|
basic_success_or_error("Error adding '#{product_name} #{version}'", response)
|
37
37
|
end
|
38
38
|
|
39
|
+
def root_ca_certificate
|
40
|
+
response = http_client.root_ca_certificate
|
41
|
+
if response.code == '200'
|
42
|
+
JSON.parse(response.body)['root_ca_certificate_pem']
|
43
|
+
else
|
44
|
+
Error.new('Error retrieving the root ca certificate', response)
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
39
48
|
def upgrade_product(product_guid, to_version)
|
40
49
|
response = http_client.upgrade_product(product_guid, to_version)
|
41
50
|
basic_success_or_error("Error upgrading '#{product_guid}' to '#{to_version}'", response)
|
@@ -86,6 +86,13 @@ module Opsmgr
|
|
86
86
|
end
|
87
87
|
end
|
88
88
|
|
89
|
+
def root_ca_certificate
|
90
|
+
req = Net::HTTP::Get.new(endpoints.root_ca_certificate_path)
|
91
|
+
add_auth_header(req)
|
92
|
+
|
93
|
+
http.request(req)
|
94
|
+
end
|
95
|
+
|
89
96
|
def add_product(product_name, version)
|
90
97
|
req = Net::HTTP::Post.new(endpoints.add_product_path)
|
91
98
|
req.set_form_data('name' => product_name, 'product_version' => version)
|
@@ -8,7 +8,6 @@ require 'ops_manager_ui_drivers'
|
|
8
8
|
require 'capybara'
|
9
9
|
require 'capybara/dsl'
|
10
10
|
require 'capybara/webkit'
|
11
|
-
require 'net/ssh/gateway'
|
12
11
|
require 'net/scp'
|
13
12
|
|
14
13
|
module Opsmgr
|
@@ -62,7 +61,7 @@ module Opsmgr
|
|
62
61
|
def configure_client_credentials
|
63
62
|
return unless Gem::Version.new(om_version) >= Gem::Version.new('1.7')
|
64
63
|
|
65
|
-
installation_settings =
|
64
|
+
installation_settings = api_client.installation_settings.as_hash
|
66
65
|
uaa_credentials = installation_settings['products'].find { |p| p['identifier'] == 'p-bosh' }['uaa_credentials']
|
67
66
|
|
68
67
|
|
@@ -70,30 +69,21 @@ module Opsmgr
|
|
70
69
|
@bosh_client_secret = uaa_credentials['password']
|
71
70
|
end
|
72
71
|
|
73
|
-
def
|
74
|
-
@
|
75
|
-
Net::SCP.download!(
|
76
|
-
env_settings['ops_manager']['url'].gsub('https://', '').delete('/'),
|
77
|
-
'ubuntu',
|
78
|
-
'/var/tempest/workspaces/default/root_ca_certificate',
|
79
|
-
filename,
|
80
|
-
ssh: { password: 'tempest', key_data: ops_manager_ssh_key }
|
81
|
-
)
|
82
|
-
filename
|
83
|
-
end
|
72
|
+
def api_client
|
73
|
+
@api_client ||= Opsmgr::Api::Client.new(Opsmgr::Environments.for(@env_name), @om_version)
|
84
74
|
end
|
85
75
|
|
86
|
-
def
|
87
|
-
|
88
|
-
|
76
|
+
def root_cert_file
|
77
|
+
return @file_path if @file_path
|
78
|
+
tmp_dir = ENV.fetch('TMPDIR', '/tmp')
|
79
|
+
FileUtils.mkpath(tmp_dir)
|
80
|
+
@file_path = tmp_dir + 'root_ca_certificate'
|
89
81
|
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
@env_settings.dig('ops_manager', 'openstack', 'ssh_private_key')
|
96
|
-
end
|
82
|
+
result = api_client.root_ca_certificate
|
83
|
+
fail result.message if result.is_a?(Api::Error)
|
84
|
+
File.write(@file_path, result)
|
85
|
+
|
86
|
+
@file_path
|
97
87
|
end
|
98
88
|
|
99
89
|
def setup_or_login
|
data/lib/opsmgr/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opsmgr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.34.
|
4
|
+
version: 0.34.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Release Engineering
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-03-
|
11
|
+
date: 2016-03-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|