staypuft 0.1.0 → 0.1.1
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/app/controllers/staypuft/deployments_controller.rb +10 -4
- data/app/lib/staypuft/deployment_param_importer.rb +3 -1
- data/app/models/staypuft/service/ui_params.rb +2 -0
- data/app/views/staypuft/deployments/_import_form.html.erb +1 -0
- data/lib/staypuft/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: 94824e862b595ccb4d2b4fb65510bb99b31dafe2
|
|
4
|
+
data.tar.gz: c6d029fd8c66373cc2e70751ae5c8f88a66c2b6f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 97ca036976447cb440e1eb31ecebe3f570ee65ce54ff9a882c8e638af13dc896d642592cfee5fa22068406396d90c4105815808c8f283ce0710a23e0fb9739d2
|
|
7
|
+
data.tar.gz: 4e5ed51e8cb30a977dc06dcfe874fe712af41d5ee9773ae2136179dc1008a933f17a27bd9727859dbec8db2f92d5e41d804f2ec37ad052530df61fd1e4da144a
|
|
@@ -102,10 +102,16 @@ module Staypuft
|
|
|
102
102
|
def import_config
|
|
103
103
|
@deployment = Deployment.find(params[:id])
|
|
104
104
|
unless params[:deployment_config_file].nil?
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
105
|
+
begin
|
|
106
|
+
new_config = YAML.load_file(params[:deployment_config_file].path)
|
|
107
|
+
DeploymentParamImporter.new(@deployment).import(new_config)
|
|
108
|
+
|
|
109
|
+
flash[:notice] = "Updated parameter values"
|
|
110
|
+
rescue Psych::SyntaxError => e
|
|
111
|
+
flash[:error] = "Invalid input file: #{e}"
|
|
112
|
+
rescue ArgumentError => e
|
|
113
|
+
flash[:error] = "Invalid input file: #{e}"
|
|
114
|
+
end
|
|
109
115
|
else
|
|
110
116
|
flash[:error] = "No import file specified"
|
|
111
117
|
end
|
|
@@ -7,7 +7,9 @@ module Staypuft
|
|
|
7
7
|
def import(in_hash)
|
|
8
8
|
hostgroups = {}
|
|
9
9
|
puppetclasses = {}
|
|
10
|
-
deployment_node = in_hash['deployment']
|
|
10
|
+
if !in_hash.is_a?(Hash) || ((deployment_node = in_hash['deployment']).nil?)
|
|
11
|
+
raise ArgumentError, "Invalid import file: no 'deployment' node found"
|
|
12
|
+
end
|
|
11
13
|
unless deployment_node.nil? || (services = deployment_node['services']).nil?
|
|
12
14
|
services.each do |service_hash|
|
|
13
15
|
handle_service(service_hash, hostgroups, puppetclasses)
|
|
@@ -23,6 +23,7 @@ Staypuft::Service::UI_PARAMS = {
|
|
|
23
23
|
'Nova (Controller)' => ['admin_email',
|
|
24
24
|
'admin_password',
|
|
25
25
|
'auto_assign_floating_ip',
|
|
26
|
+
'controller_admin_host',
|
|
26
27
|
'controller_priv_host',
|
|
27
28
|
'controller_pub_host',
|
|
28
29
|
'freeipa',
|
|
@@ -44,6 +45,7 @@ Staypuft::Service::UI_PARAMS = {
|
|
|
44
45
|
'admin_password',
|
|
45
46
|
'cisco_nexus_plugin',
|
|
46
47
|
'cisco_vswitch_plugin',
|
|
48
|
+
'controller_admin_host',
|
|
47
49
|
'controller_priv_host',
|
|
48
50
|
'controller_pub_host',
|
|
49
51
|
'enable_tunneling',
|
data/lib/staypuft/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: staypuft
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Staypuft team
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2014-06-
|
|
11
|
+
date: 2014-06-06 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: foreman-tasks
|