knife-cfn 0.1.7 → 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -29,6 +29,12 @@ class Chef
29
29
 
30
30
  banner "knife cfn outputs <stack name>"
31
31
 
32
+ option :output_parameter_format,
33
+ :short => "-o",
34
+ :long => "--output_parameter_format",
35
+ :description => "Stack output is formatted in a suitable syntax to use for parameters for another stack",
36
+ :proc => Proc.new{ |o| Chef::Config[:knife][:output_format] = "parameter" }
37
+
32
38
  def run
33
39
  $stdout.sync = true
34
40
 
@@ -66,20 +72,32 @@ class Chef
66
72
  end
67
73
  exit 1
68
74
  else
75
+ parameter_output=""
76
+ delim=""
69
77
  data.each do |stack|
70
78
  row1 = true
79
+ parameter_output += delim
80
+ delim="\n"
81
+ parameter_output+=stack["StackName"] + ": "
71
82
  events_list << stack["StackName"]
72
83
  stack["Outputs"].each do |output|
73
84
  if !row1
74
85
  events_list << ""
86
+ parameter_output += ";"
75
87
  end
76
88
  events_list << output["OutputKey"]
77
89
  events_list << output["OutputValue"]
78
90
  events_list << output["Description"]
91
+ parameter_output += output["OutputKey"] + "=" + output["OutputValue"]
79
92
  row1 = false
80
93
  end
81
94
  end
82
- puts ui.list(events_list, :uneven_columns_across, 4)
95
+ if locate_config_value(:output_format) == "parameter"
96
+ puts parameter_output
97
+ else
98
+ puts ui.list(events_list, :uneven_columns_across, 4)
99
+ end
100
+
83
101
  end
84
102
  end
85
103
  end
@@ -1,3 +1,3 @@
1
- module KnifeCfn
2
- VERSION = "0.1.6"
3
- end
1
+ module KnifeCfn
2
+ VERSION = "0.1.8"
3
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: knife-cfn
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-08-01 00:00:00.000000000 Z
12
+ date: 2013-12-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: fog