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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3838e8c00d0d5bb0470cfb8ec3ead91142f0dec7
4
- data.tar.gz: ea81452c4bd0eb33f7d3e80483130b203b865683
3
+ metadata.gz: 94824e862b595ccb4d2b4fb65510bb99b31dafe2
4
+ data.tar.gz: c6d029fd8c66373cc2e70751ae5c8f88a66c2b6f
5
5
  SHA512:
6
- metadata.gz: 68f8d5ba659d5126bb79d7545b50a05c3f4e63403b3454524c03b0bd2bde8bcfa8d0477c791ffbdc1eba53472a33536cb5d051eee8013e9f42320236cf5347c9
7
- data.tar.gz: 3735abe4f8ab42404e9e1e05fea550bc1f9b20687702c38024d5af5c6c77f3c0db95b7cf9611e7b3ffae7a92b65ce0cd651177bc643f8c18dc3c5e2efa0d039a
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
- new_config = YAML.load_file(params[:deployment_config_file].path)
106
- DeploymentParamImporter.new(@deployment).import(new_config)
107
-
108
- flash[:notice] = "Updated parameter values"
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',
@@ -1,3 +1,4 @@
1
+ <p><%= _("Please upload a previously exported YAML formatted file.") %></p>
1
2
  <%= form_tag(import_config_deployment_path(@deployment.id),
2
3
  multipart: true,
3
4
  class: 'col-md-12',
@@ -1,3 +1,3 @@
1
1
  module Staypuft
2
- VERSION = '0.1.0'
2
+ VERSION = '0.1.1'
3
3
  end
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.0
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-04 00:00:00.000000000 Z
11
+ date: 2014-06-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: foreman-tasks