{"action":"created","issue":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/15346","repository_url":"https://api.github.com/repos/hashicorp/terraform","labels_url":"https://api.github.com/repos/hashicorp/terraform/issues/15346/labels{/name}","comments_url":"https://api.github.com/repos/hashicorp/terraform/issues/15346/comments","events_url":"https://api.github.com/repos/hashicorp/terraform/issues/15346/events","html_url":"https://github.com/hashicorp/terraform/issues/15346","id":237288159,"number":15346,"title":"\"external\" provider returns an invalid json","user":{"login":"rzubin","id":4560943,"avatar_url":"https://avatars1.githubusercontent.com/u/4560943?v=3","gravatar_id":"","url":"https://api.github.com/users/rzubin","html_url":"https://github.com/rzubin","followers_url":"https://api.github.com/users/rzubin/followers","following_url":"https://api.github.com/users/rzubin/following{/other_user}","gists_url":"https://api.github.com/users/rzubin/gists{/gist_id}","starred_url":"https://api.github.com/users/rzubin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rzubin/subscriptions","organizations_url":"https://api.github.com/users/rzubin/orgs","repos_url":"https://api.github.com/users/rzubin/repos","events_url":"https://api.github.com/users/rzubin/events{/privacy}","received_events_url":"https://api.github.com/users/rzubin/received_events","type":"User","site_admin":false},"labels":[{"id":85946961,"url":"https://api.github.com/repos/hashicorp/terraform/labels/question","name":"question","color":"cc317c","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2017-06-20T17:32:16Z","updated_at":"2017-06-20T18:11:47Z","closed_at":null,"body":"### Terraform Version\r\nTerraform v0.9.8\r\n\r\n### Terraform Configuration Files\r\n```hcl\r\ndata \"external\" \"get_ip\" {\r\n  program = [\"python\", \"get_ip_from_ipam.py\"]\r\n  query = {\r\n    network = \"10.190.170.0\"\r\n  }\r\n}\r\n```\r\n\r\n\r\n### Debug Output\r\n```data.external.get_ip: Refreshing state...\r\n  Error refreshing state: 1 error(s) occurred:\r\n  data.external.get_ip: 1 error(s) occurred:\r\n  data.external.get_ip: data.external.get_ip: command \"python\" produced invalid JSON: invalid \r\n  character 'S' looking for beginning of value\r\n```\r\n\r\n### Expected Behavior\r\n    ipv4_address = \"${data.external.get_ip.result[\"ip\"]}\" \r\nipv4_address should have been set to 10.190.170.37\r\n\r\n\r\n### Actual Behavior\r\nHere is what the returned json looks like \r\n`\"{'ip': '10.190.170.37', 'network': '10.190.170.0'}\"`\r\n"},"comment":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/comments/309842259","html_url":"https://github.com/hashicorp/terraform/issues/15346#issuecomment-309842259","issue_url":"https://api.github.com/repos/hashicorp/terraform/issues/15346","id":309842259,"user":{"login":"rzubin","id":4560943,"avatar_url":"https://avatars1.githubusercontent.com/u/4560943?v=3","gravatar_id":"","url":"https://api.github.com/users/rzubin","html_url":"https://github.com/rzubin","followers_url":"https://api.github.com/users/rzubin/followers","following_url":"https://api.github.com/users/rzubin/following{/other_user}","gists_url":"https://api.github.com/users/rzubin/gists{/gist_id}","starred_url":"https://api.github.com/users/rzubin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rzubin/subscriptions","organizations_url":"https://api.github.com/users/rzubin/orgs","repos_url":"https://api.github.com/users/rzubin/repos","events_url":"https://api.github.com/users/rzubin/events{/privacy}","received_events_url":"https://api.github.com/users/rzubin/received_events","type":"User","site_admin":false},"created_at":"2017-06-20T18:11:47Z","updated_at":"2017-06-20T18:11:47Z","body":"Hey @apparentlymart \r\n\r\nI did try that. \r\n\r\n```\r\nsys.stdout = open('log.txt', 'w')\r\ninput = {\r\n    \"network\": \"10.190.170.0\",\r\n    \"host_fqdn\": \"abc.com\"\r\n}\r\nresult = get_free_ip_address(input['network'], input['host_fqdn'])\r\nprint(result)\r\njson.dump(result, sys.stdout)\r\nsys.stdout.close()\r\n```\r\nBelow is the log.txt file that shows the sys.stdout\r\n\r\n```\r\n{u'ip': u'10.190.170.37'}\r\n{\"ip\": \"10.190.170.37\"}\r\n```"}}
{"actor":{"display_login":"rzubin"}}