knife-joyent 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGES.md CHANGED
@@ -1,6 +1,14 @@
1
1
  knife-joyent Changelog
2
2
  ===
3
3
 
4
+ ## 0.3.2 (master)
5
+
6
+
7
+ ## 0.3.1
8
+
9
+ - GH-55 Allow disabling SSL certificate verification + tags compatibility for SDC 6.5
10
+ - GH-53 Command line arguments now properly takes precidense over config defined in knife.rb
11
+
4
12
  ## 0.3.0
5
13
 
6
14
  - GH-49 Network api support
data/README.md CHANGED
@@ -115,6 +115,11 @@ can be overridden in knife.rb as follows:
115
115
 
116
116
  Some command line options to knife-joyent subcommands may depend on the Joyent API version set.
117
117
 
118
+ **``joyent_verify_peer``**
119
+
120
+ Set to false to Disable SSL Cert verification, required if the CloudAPI instance
121
+ uses a self-signed cert.
122
+
118
123
  **``provisioner``**
119
124
 
120
125
  Machines provisioned will be tagged with key ``provisioner`` containing the value specified.
@@ -54,21 +54,29 @@ class Chef
54
54
  end
55
55
 
56
56
  def connection
57
+ if (Chef::Config[:knife][:joyent_verify_peer] rescue nil)
58
+ Excon.defaults[:ssl_verify_peer] = false
59
+ end
60
+
57
61
  @connection ||= begin
58
62
  Fog::Compute.new(
59
63
  :provider => 'Joyent',
60
- :joyent_username => Chef::Config[:knife][:joyent_username],
61
- :joyent_password => Chef::Config[:knife][:joyent_password],
62
- :joyent_keyname => Chef::Config[:knife][:joyent_keyname],
63
- :joyent_keyfile => Chef::Config[:knife][:joyent_keyfile],
64
-
65
- :joyent_url => Chef::Config[:knife][:joyent_api_url],
66
- :joyent_version => Chef::Config[:knife][:joyent_version]
64
+ :joyent_username => locate_config_value(:joyent_username),
65
+ :joyent_password => locate_config_value(:joyent_password),
66
+ :joyent_keyname => locate_config_value(:joyent_keyname),
67
+ :joyent_keyfile => locate_config_value(:joyent_keyfile),
67
68
 
69
+ :joyent_url => locate_config_value(:joyent_api_url),
70
+ :joyent_version => locate_config_value(:joyent_version)
68
71
  )
69
72
  end
70
73
  end
71
74
 
75
+ def locate_config_value(key)
76
+ key = key.to_sym
77
+ config[key] || Chef::Config[:knife][key]
78
+ end
79
+
72
80
  def msg_pair(label, value = nil)
73
81
  if value && !value.empty?
74
82
  puts "#{ui.color(label, :cyan)}: #{value}"
@@ -43,7 +43,10 @@ class Chef
43
43
  servers << s.ips.join(" ")
44
44
  servers << "#{s.memory/1024} GB".to_s
45
45
  servers << "#{s.disk/1024} GB".to_s
46
- servers << s.tags.map { |k, v| "#{k}:#{v}" }.join(' ')
46
+
47
+ if (servers.tags rescue nil)
48
+ servers << s.tags.map { |k, v| "#{k}:#{v}" }.join(' ')
49
+ end
47
50
  end
48
51
 
49
52
  puts ui.list(servers, :uneven_columns_across, 9)
@@ -1,3 +1,3 @@
1
1
  module KnifeJoyent
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: knife-joyent
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
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-06-18 00:00:00.000000000 Z
12
+ date: 2013-06-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: fog
@@ -124,4 +124,3 @@ signing_key:
124
124
  specification_version: 3
125
125
  summary: Joyent CloudAPI Support for Chef's Knife Command
126
126
  test_files: []
127
- has_rdoc: true