knife-vsphere 0.1.9 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -23,7 +23,9 @@ class Chef
23
23
  end
24
24
 
25
25
  def self.get_common_options
26
- $default = Hash.new
26
+ unless defined? $default
27
+ $default = Hash.new
28
+ end
27
29
 
28
30
  option :vsphere_user,
29
31
  :short => "-u USERNAME",
@@ -72,7 +74,9 @@ class Chef
72
74
 
73
75
  def get_config(key)
74
76
  key = key.to_sym
75
- config[key] || Chef::Config[:knife][key] || $default[key]
77
+ rval = config[key] || Chef::Config[:knife][key] || $default[key]
78
+ Chef::Log.debug("value for config item #{key}: #{rval}")
79
+ rval
76
80
  end
77
81
 
78
82
  def get_vim_connection
@@ -168,6 +168,10 @@ class Chef::Knife::VsphereVmClone < Chef::Knife::BaseVsphereCommand
168
168
  config[:chef_node_name] = vmname unless config[:chef_node_name]
169
169
  config[:vmname] = vmname
170
170
 
171
+ if get_config(:bootstrap) && get_config(:distro) && !@@chef_config_dir
172
+ fatal_exit("Can't find .chef for bootstrap files. chdir to a location with a .chef directory and try again")
173
+ end
174
+
171
175
  vim = get_vim_connection
172
176
 
173
177
  dcname = get_config(:vsphere_dc)
@@ -1,4 +1,4 @@
1
1
  module KnifeVsphere
2
- VERSION = "0.1.9"
2
+ VERSION = "0.2.0"
3
3
  end
4
4
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: knife-vsphere
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.2.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,12 +9,12 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-04-16 00:00:00.000000000 -05:00
12
+ date: 2012-04-23 00:00:00.000000000 -05:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: netaddr
17
- requirement: &70231050321420 !ruby/object:Gem::Requirement
17
+ requirement: &70204407338120 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ~>
@@ -22,10 +22,10 @@ dependencies:
22
22
  version: 1.5.0
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *70231050321420
25
+ version_requirements: *70204407338120
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: chef
28
- requirement: &70231050320800 !ruby/object:Gem::Requirement
28
+ requirement: &70204407337400 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ~>
@@ -33,10 +33,10 @@ dependencies:
33
33
  version: 0.10.0
34
34
  type: :runtime
35
35
  prerelease: false
36
- version_requirements: *70231050320800
36
+ version_requirements: *70204407337400
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: rbvmomi
39
- requirement: &70231050320140 !ruby/object:Gem::Requirement
39
+ requirement: &70204407336680 !ruby/object:Gem::Requirement
40
40
  none: false
41
41
  requirements:
42
42
  - - ~>
@@ -44,7 +44,7 @@ dependencies:
44
44
  version: 1.2.3
45
45
  type: :runtime
46
46
  prerelease: false
47
- version_requirements: *70231050320140
47
+ version_requirements: *70204407336680
48
48
  description: VMware vSphere Support for Chef's Knife Command
49
49
  email: ezra@cpan.org
50
50
  executables: []