The Puppet Labs Issue Tracker has Moved: https://tickets.puppetlabs.com

Bug #3753

Exec commands can't be undef

Added by Nigel Kersten about 4 years ago. Updated over 3 years ago.

Status:AcceptedStart date:05/11/2010
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:error reporting
Target version:-
Affected Puppet version:0.25.4 Branch:
Keywords:

We've Moved!

Ticket tracking is now hosted in JIRA: https://tickets.puppetlabs.com

This ticket may be automatically exported to the PUP project on JIRA using the button below:


Description

I’m not 100% convinced this is a bug, it may be a feature request or it may be a dumb idea.

You can’t ‘undef’ an Exec command currently, I discovered this when one of my staff did:

$testvar="one"

exec { "foo":
  path => "/bin",
  command => $testvar ? {
    "woot"  => "/bin/echo woot",
    default => undef,
  }
}

results in:

debug: //Exec[foo]: Changing returns
debug: //Exec[foo]: 1 change(s)
debug: //Exec[foo]: Executing 'foo'
debug: Executing 'foo'
err: //Exec[foo]/returns: change from notrun to 0 failed: foo returned 1 instead of one of [0] at /tmp/test.pp:10

I’m unsure what the correct behavior is here, but at the least I feel like a better error message might be in order.

History

#1 Updated by Nigel Kersten about 4 years ago

Oh, I accidentally showed the version with the path set. If you don’t set a path, like:


$testvar="one"

exec { "foo":
  command => $testvar ? {
    "woot"  => "/bin/echo woot",
    default => undef,
  }
}

results in:

'foo' is both unqualifed and specified no search path at /tmp/test.pp:9

Which is also misleading.

#2 Updated by James Turnbull about 4 years ago

  • Category set to error reporting
  • Status changed from Unreviewed to Accepted
  • Target version set to 49

#3 Updated by James Turnbull over 3 years ago

  • Target version deleted (49)

Also available in: Atom PDF