{"action":"opened","issue":{"url":"https://api.github.com/repos/mitchellh/packer/issues/2363","labels_url":"https://api.github.com/repos/mitchellh/packer/issues/2363/labels{/name}","comments_url":"https://api.github.com/repos/mitchellh/packer/issues/2363/comments","events_url":"https://api.github.com/repos/mitchellh/packer/issues/2363/events","html_url":"https://github.com/mitchellh/packer/issues/2363","id":92034750,"number":2363,"title":"Unable to use build_name function in template with Packer v0.8.0","user":{"login":"mvermaes","id":4127064,"avatar_url":"https://avatars.githubusercontent.com/u/4127064?v=3","gravatar_id":"","url":"https://api.github.com/users/mvermaes","html_url":"https://github.com/mvermaes","followers_url":"https://api.github.com/users/mvermaes/followers","following_url":"https://api.github.com/users/mvermaes/following{/other_user}","gists_url":"https://api.github.com/users/mvermaes/gists{/gist_id}","starred_url":"https://api.github.com/users/mvermaes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mvermaes/subscriptions","organizations_url":"https://api.github.com/users/mvermaes/orgs","repos_url":"https://api.github.com/users/mvermaes/repos","events_url":"https://api.github.com/users/mvermaes/events{/privacy}","received_events_url":"https://api.github.com/users/mvermaes/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-06-30T09:18:09Z","updated_at":"2015-06-30T09:18:09Z","closed_at":null,"body":"Hi, I'm trying to use the `build_name`/`build_type` functions that were introduced with v0.8.0, but I always receive a message saying that it is not available. Example:\r\n\r\n    $ cat test.json\r\n    {\r\n      \"builders\": [{\r\n        \"type\": \"amazon-ebs\",\r\n        \"region\": \"us-east-1\",\r\n        \"source_ami\": \"ami-c65be9ae\",\r\n        \"instance_type\": \"t1.micro\",\r\n        \"ssh_username\": \"ubuntu\",\r\n        \"ami_name\": \"packer-example {{timestamp}}\"\r\n      }],\r\n      \"provisioners\": [{\r\n        \"type\": \"shell-local\",\r\n        \"command\": \"echo {{build_type}}\"\r\n      }]\r\n    }\r\n    $ packer validate test.json \r\n    Template validation failed. Errors are shown below.\r\n\r\n    Errors validating build 'amazon-ebs'. render 'command': template: root:1:7: executing \"root\" at <build_type>: error calling build_type: build_name not available in:\r\n\r\n    echo {{build_type}}\r\n\r\nSubstituting `pwd` or `timestamp` validates successfully. I get the same behaviour with CentOS 7.1.1503 and OS X 10.10.3.\r\n\r\nSomewhat related, I think line 74 of `template/interpolate/funcs.go` should reference `build_type` instead of `build_name`."}}