Puppet how to tell if a variable is set

Viewed 29758

In a puppet class how should I test if a variable has been set or not? Right now I am just checking if a variable is undefined:

if $http_port != undef {
  $run_command = "$run_command --http-port $http_port"
}

Is there a better way to check if a variable has been declared or not?

1 Answers
Related