Giter Club home page Giter Club logo

Comments (11)

igalic avatar igalic commented on September 26, 2024

@randradas would you like to provide us with a patch for this?

from puppet-archive.

randradas avatar randradas commented on September 26, 2024

yes!, I would. I've just push it on pull requests.

from puppet-archive.

nanliu avatar nanliu commented on September 26, 2024

Odd the original spec 4c469d3 had the extra double quote, wonder how it was working originally. Is this fixed by #143?

from puppet-archive.

randradas avatar randradas commented on September 26, 2024

as far as I know and according with wget man page, only double quotes before '--header=' and the final one are needed. https://www.gnu.org/software/wget/manual/wget.html. #143 removes this extra double quote that should not be there according with wget documentation. this issue can be closed.

from puppet-archive.

nanliu avatar nanliu commented on September 26, 2024

When I'm testing with the following resource, I'm only getting an html page:

archive { '/tmp/jdk-7u80-linux-x64.tar.gz':
  source   => 'http://download.oracle.com/otn-pub/java/jdk/7u80-b15/jdk-7u80-linux-x64.tar.gz',
  cookie   => 'oraclelicense=accept-securebackup-cookie',
  provider => 'wget',
}
$ file /tmp/jdk-7u80-linux-x64.tar.gz
/tmp/jdk-7u80-linux-x64.tar.gz: HTML document text
$ head /tmp/jdk-7u80-linux-x64.tar.gz
<html>
<head>
<title>Unauthorized Request</title>
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<link rel="stylesheet" type="text/css" href="/errors/us/assets/hp-styles.css" />
<link rel="stylesheet" type="text/css" href="/errors/us/assets/master-master.css" />

<body style="margin: 0px" bgcolor=#ffffff>
<div id="banner">

Do you have an working example?

from puppet-archive.

nanliu avatar nanliu commented on September 26, 2024

After some testing the following works:

command = "wget #{params.join(' ')}"
Puppet::Util::Execution.execute(command)

and this does not:

wget(params)

I suspect there was an extra double qoute because something with puppet metaprogrammed wget method is not handling the quotes correctly.

from puppet-archive.

randradas avatar randradas commented on September 26, 2024

Even with extra double quote you will obtain that page, this is what lead me to find that double quote. However jdk downloading works with curl.

So maybe receiving that web is not related with the "extra double quote" and should be managed like another issue.

from puppet-archive.

nanliu avatar nanliu commented on September 26, 2024

Ok, it's a problem with Puppet::Util::Execution.execute:

cmd = ["wget",
 "http://download.oracle.com/otn-pub/java/jdk/7u80-b15/jdk-7u80-linux-x64.tar.gz",
 "-O",
 "/tmp/jdk-7u80-linux-x64.tar.gz_20160317-16253-1m9avpd",
 "--max-redirect=5",
 "--header=\"Cookie: oraclelicense=accept-securebackup-cookie\""]

This fails: Puppet::Util::Execution.execute(cmd), but this works Puppet::Util::Execution.execute(cmd.join(' ')). This is why wget(params) does not work, but my work around did. I'll put in a fix. Puppet::Util::Execution is not happy with the " escape double quote. In curl, the commands is something like:

["curl",
 "http://download.oracle.com/otn-pub/java/jdk/7u80-b15/jdk-7u80-linux-x64.tar.gz",
 "--cookie",
"oraclelicense=accept-securebackup-cookie"]

Since curl does not have ", it does not trigger this problem.

from puppet-archive.

jyaworski avatar jyaworski commented on September 26, 2024

What puppet version? That sounds like a puppet bug.

from puppet-archive.

nanliu avatar nanliu commented on September 26, 2024

It's at least affecting PE 3.8. Hard to say what other versions since I can't just do git bisect and run spec tests. However looking at the history of puppet::util::execution, there are few recent changes. @randradas, what's your puppet version?

from puppet-archive.

randradas avatar randradas commented on September 26, 2024

Puppet Open Source 3.8.4 in my case. Running on master and agents.

from puppet-archive.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.