chef-metal 0.9 → 0.9.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 07e0cfcc01b7e848ee6d6f179b128f5c4a09bd13
4
- data.tar.gz: 81d09bd6ee53807461a1ca10811f1a128024352e
3
+ metadata.gz: d5fdc35ab0b1d5515d7ef8c93e9818b9be68bb62
4
+ data.tar.gz: 928fc0d4d3e02ff2c4dd89d00199cb32e3482efa
5
5
  SHA512:
6
- metadata.gz: 8701093c85d54d2f5e0c1a2cc3d1b7662530f9254580e63f70e901d27b6c7f6398d6fe1d6ccc2ca7d134fabde917d83c4e6a031c00b748905e143f28864e1c68
7
- data.tar.gz: b353d45dc362657b6c2e01d998516339d981e825dd807d6e25526ee9b7e510a625662c3e607f6024d39cf5ab0de615696af321d5338e6bb9bee76a35ece9d350
6
+ metadata.gz: b9461ee53fcb21a3825868b21c3d343b80b54a665652dfcce8a404c3bc8f539ea269453233faf83d24918563108d581742723ab8a7f7affb7db5a2323e19c591
7
+ data.tar.gz: 77247e2fa8c55d9faa8492d0881622da6023dc040c7c01651d94a1f7da677012b5f16931202ca167c664ac132551d1504560652e9dd73ba38c2917283803fdcb
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Chef Metal Changelog
2
2
 
3
+ ## 0.9.1 (4/11/2014)
4
+
5
+ - Make write_file and upload_file create parent directory
6
+
3
7
  ## 0.9 (4/9/2014)
4
8
 
5
9
  - Add `files` and `file` attributes to the `machine` resource
data/bin/metal CHANGED
@@ -6,6 +6,7 @@ require 'chef_metal'
6
6
  require 'chef/rest'
7
7
  require 'chef/application'
8
8
  require 'chef/knife'
9
+ require 'chef/run_context'
9
10
  require 'chef/server_api'
10
11
  require 'chef_metal/action_handler'
11
12
  require 'chef_metal/version'
@@ -75,12 +75,13 @@ module ChefMetal
75
75
  end
76
76
 
77
77
  def write_file(path, content)
78
+ execute("mkdir -p #{File.dirname(path)}").error!
78
79
  if options[:prefix]
79
80
  # Make a tempfile on the other side, upload to that, and sudo mv / chown / etc.
80
81
  remote_tempfile = "/tmp/#{File.basename(path)}.#{Random.rand(2**32)}"
81
82
  Chef::Log.debug("Writing #{content.length} bytes to #{remote_tempfile} on #{username}@#{host}")
82
83
  Net::SCP.new(session).upload!(StringIO.new(content), remote_tempfile)
83
- execute("mv #{remote_tempfile} #{path}")
84
+ execute("mv #{remote_tempfile} #{path}").error!
84
85
  else
85
86
  Chef::Log.debug("Writing #{content.length} bytes to #{path} on #{username}@#{host}")
86
87
  Net::SCP.new(session).upload!(StringIO.new(content), path)
@@ -88,12 +89,13 @@ module ChefMetal
88
89
  end
89
90
 
90
91
  def upload_file(local_path, path)
92
+ execute("mkdir -p #{File.dirname(path)}").error!
91
93
  if options[:prefix]
92
94
  # Make a tempfile on the other side, upload to that, and sudo mv / chown / etc.
93
95
  remote_tempfile = "/tmp/#{File.basename(path)}.#{Random.rand(2**32)}"
94
96
  Chef::Log.debug("Uploading #{local_path} to #{remote_tempfile} on #{username}@#{host}")
95
97
  Net::SCP.new(session).upload!(local_path, remote_tempfile)
96
- execute("mv #{remote_tempfile} #{path}")
98
+ execute("mv #{remote_tempfile} #{path}").error!
97
99
  else
98
100
  Chef::Log.debug("Uploading #{local_path} to #{path} on #{username}@#{host}")
99
101
  Net::SCP.new(session).upload!(local_path, path)
@@ -1,3 +1,3 @@
1
1
  module ChefMetal
2
- VERSION = '0.9'
2
+ VERSION = '0.9.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef-metal
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.9'
4
+ version: 0.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Keiser
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-11 00:00:00.000000000 Z
11
+ date: 2014-04-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chef
@@ -84,30 +84,30 @@ dependencies:
84
84
  name: chef-metal-fog
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - '>='
87
+ - - ~>
88
88
  - !ruby/object:Gem::Version
89
- version: '0'
89
+ version: '0.2'
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - '>='
94
+ - - ~>
95
95
  - !ruby/object:Gem::Version
96
- version: '0'
96
+ version: '0.2'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: chef-metal-vagrant
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - '>='
101
+ - - ~>
102
102
  - !ruby/object:Gem::Version
103
- version: '0'
103
+ version: '0.2'
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - '>='
108
+ - - ~>
109
109
  - !ruby/object:Gem::Version
110
- version: '0'
110
+ version: '0.2'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: rspec
113
113
  requirement: !ruby/object:Gem::Requirement