Skip to content

Commit 3d7c43f

Browse files
authored
Merge pull request #31 from jordiprats/master
improved download resource
2 parents 6af2da5 + 28f2ca8 commit 3d7c43f

File tree

5 files changed

+15
-6
lines changed

5 files changed

+15
-6
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# CHANGELOG
22

3+
## 0.1.24
4+
5+
* modified **download** resource to use **curl** instead of **wget**
6+
* fix magic hash fact
7+
38
## 0.1.23
49

510
* simplified **eypconf** fact generation

lib/facter/eypconf_generic_id.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@
44
genetic_id = Facter::Util::Resolution.exec("bash -c 'cat /opt/eypconf/id/#{i}'").to_s
55

66
if i[0]=='.' then
7-
fact_name=i[1..-1]
7+
if i == ".magic" then
8+
fact_name="magic_hash"
9+
else
10+
fact_name=i[1..-1]
11+
end
812
else
913
fact_name=i
1014
end

lib/puppet/provider/download/download_linux.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ def check_created_file(file)
1616
end
1717

1818
def run_wget_command(url)
19-
20-
command = ["wget"]
19+
#curl https://yum.puppet.com/puppet5/puppet5-release-el-7.noarch.rpm --create-dirs -o /tmp/prova/cosa/rpm
20+
command = ["curl"]
2121
command.push(url)
22-
command.push("-O ", resource[:creates])
22+
command.push("--create-dirs", "-o ", resource[:creates])
2323

2424
if resource[:cwd]
2525
Dir.chdir resource[:cwd] do

lib/puppet/type/download.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def retrieve
2323

2424
def sync
2525
output, status = provider.run_wget_command(value)
26-
self.fail("Error executing wget; returned #{status}: '#{output}'") unless status == 0
26+
self.fail("Error executing curl; returned #{status}: '#{output}'") unless status == 0
2727
end
2828
end
2929

metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "eyp-eyplib",
3-
"version": "0.1.23",
3+
"version": "0.1.24",
44
"author": "eyp",
55
"summary": "Utility functions for puppet modules",
66
"license": "Apache-2.0",

0 commit comments

Comments
 (0)