{"action":"created","comment":{"url":"https://api.github.com/repos/puppetlabs/puppetlabs-websphere/pulls/comments/41458719","id":41458719,"diff_hunk":"@@ -0,0 +1,59 @@\n+require 'puppet/provider/websphere_helper'\n+\n+Puppet::Type.type(:websphere_host_alias).provide(:wsadmin, :parent => Puppet::Provider::Websphere_Helper) do\n+\n+  def exists?\n+    # If it doesn't exist, the wsadmin should fail but since :failonfail is false it will create \n+    ## (J|P)ython is whitespace sensitive, and this bit doesn't do well when\n+    ## being passed as a normal command-line argument. \n+    cmd = <<-END\n+host_aliases =  AdminConfig.list('HostAlias', AdminConfig.getid( '/Cell:CELL_01/VirtualHost:test_vhost/')).split(lineSeparator)\n+for alias in host_aliases:\n+  hostname = AdminConfig.showAttribute(alias, 'hostname')\n+  port = AdminConfig.showAttribute(alias, 'port')\n+  if hostname == '#{resource[:hostname]}' and port == '#{resource[:port]}':\n+      print hostname + ':' + port\n+      break\n+END\n+\n+     self.debug \"Running #{cmd}\"\n+     result = wsadmin(:file => cmd, :user => resource[:user], :failonfail => false)\n+     self.debug \"Result:\\n#{result}\"\n+\n+     unless result =~ /.*#{resource[:hostname]}:#{resource[:port]}/\n+       return false\n+     end\n+     true  \n+  end\n+  \n+  def create\n+    # AdminConfig.create('HostAlias', AdminConfig.getid('/Cell:CELL_01/VirtualHost:TESTING/'), '[[hostname \"testing.com\"] [port \"80\"]]')\n+    cmd = \"\\\"AdminConfig.create('HostAlias', \"\n+    cmd += \"AdminConfig.getid('/Cell:#{resource[:cell]}/VirtualHost:#{resource[:virtual_host]}/'), \"\n+    cmd += \"'[[hostname \\\"#{resource[:hostname]}\\\"] \"\n+    cmd += \"[port \\\"#{resource[:port]}\\\"]]')\\\"\"\n+    \n+    self.debug \"Running #{cmd}\"\n+    result = wsadmin(:command => cmd, :user => resource[:user])\n+    self.debug result\n+  end\n+  \n+  def destroy\n+    cmd = <<-END\n+host_aliases =  AdminConfig.list('HostAlias', AdminConfig.getid( '/Cell:CELL_01/VirtualHost:test_vhost/')).split(lineSeparator)","path":"lib/puppet/provider/websphere_host_alias/wsadmin.rb","position":43,"original_position":43,"commit_id":"afa289ae4c4a571149e47f099caa70fcc031af20","original_commit_id":"afa289ae4c4a571149e47f099caa70fcc031af20","user":{"login":"joshbeard","id":1117472,"avatar_url":"https://avatars.githubusercontent.com/u/1117472?v=3","gravatar_id":"","url":"https://api.github.com/users/joshbeard","html_url":"https://github.com/joshbeard","followers_url":"https://api.github.com/users/joshbeard/followers","following_url":"https://api.github.com/users/joshbeard/following{/other_user}","gists_url":"https://api.github.com/users/joshbeard/gists{/gist_id}","starred_url":"https://api.github.com/users/joshbeard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joshbeard/subscriptions","organizations_url":"https://api.github.com/users/joshbeard/orgs","repos_url":"https://api.github.com/users/joshbeard/repos","events_url":"https://api.github.com/users/joshbeard/events{/privacy}","received_events_url":"https://api.github.com/users/joshbeard/received_events","type":"User","site_admin":false},"body":"@bFekete should the cell and virtualhost name be hard coded here?","created_at":"2015-10-07T22:58:31Z","updated_at":"2015-10-07T22:58:31Z","html_url":"https://github.com/puppetlabs/puppetlabs-websphere/pull/8#discussion_r41458719","pull_request_url":"https://api.github.com/repos/puppetlabs/puppetlabs-websphere/pulls/8","_links":{"self":{"href":"https://api.github.com/repos/puppetlabs/puppetlabs-websphere/pulls/comments/41458719"},"html":{"href":"https://github.com/puppetlabs/puppetlabs-websphere/pull/8#discussion_r41458719"},"pull_request":{"href":"https://api.github.com/repos/puppetlabs/puppetlabs-websphere/pulls/8"}}},"pull_request":{"url":"https://api.github.com/repos/puppetlabs/puppetlabs-websphere/pulls/8","id":42517359,"html_url":"https://github.com/puppetlabs/puppetlabs-websphere/pull/8","diff_url":"https://github.com/puppetlabs/puppetlabs-websphere/pull/8.diff","patch_url":"https://github.com/puppetlabs/puppetlabs-websphere/pull/8.patch","issue_url":"https://api.github.com/repos/puppetlabs/puppetlabs-websphere/issues/8","number":8,"state":"open","locked":false,"title":"0.x","user":{"login":"bFekete","id":8890410,"avatar_url":"https://avatars.githubusercontent.com/u/8890410?v=3","gravatar_id":"","url":"https://api.github.com/users/bFekete","html_url":"https://github.com/bFekete","followers_url":"https://api.github.com/users/bFekete/followers","following_url":"https://api.github.com/users/bFekete/following{/other_user}","gists_url":"https://api.github.com/users/bFekete/gists{/gist_id}","starred_url":"https://api.github.com/users/bFekete/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bFekete/subscriptions","organizations_url":"https://api.github.com/users/bFekete/orgs","repos_url":"https://api.github.com/users/bFekete/repos","events_url":"https://api.github.com/users/bFekete/events{/privacy}","received_events_url":"https://api.github.com/users/bFekete/received_events","type":"User","site_admin":false},"body":"Adds the ability for Puppet to manage: virtual hosts, host aliases, cookies, and custom services.\r\n\r\n\r\nAlso fixed some of the JVM parameters.","created_at":"2015-08-15T10:27:06Z","updated_at":"2015-10-07T22:58:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"182d3b96bda542f42ba0d5acd6366ffa6654df8d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/puppetlabs/puppetlabs-websphere/pulls/8/commits","review_comments_url":"https://api.github.com/repos/puppetlabs/puppetlabs-websphere/pulls/8/comments","review_comment_url":"https://api.github.com/repos/puppetlabs/puppetlabs-websphere/pulls/comments{/number}","comments_url":"https://api.github.com/repos/puppetlabs/puppetlabs-websphere/issues/8/comments","statuses_url":"https://api.github.com/repos/puppetlabs/puppetlabs-websphere/statuses/afa289ae4c4a571149e47f099caa70fcc031af20","head":{"label":"bFekete:0.x","ref":"0.x","sha":"afa289ae4c4a571149e47f099caa70fcc031af20","user":{"login":"bFekete","id":8890410,"avatar_url":"https://avatars.githubusercontent.com/u/8890410?v=3","gravatar_id":"","url":"https://api.github.com/users/bFekete","html_url":"https://github.com/bFekete","followers_url":"https://api.github.com/users/bFekete/followers","following_url":"https://api.github.com/users/bFekete/following{/other_user}","gists_url":"https://api.github.com/users/bFekete/gists{/gist_id}","starred_url":"https://api.github.com/users/bFekete/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bFekete/subscriptions","organizations_url":"https://api.github.com/users/bFekete/orgs","repos_url":"https://api.github.com/users/bFekete/repos","events_url":"https://api.github.com/users/bFekete/events{/privacy}","received_events_url":"https://api.github.com/users/bFekete/received_events","type":"User","site_admin":false},"repo":{"id":39773135,"name":"puppetlabs-websphere","full_name":"bFekete/puppetlabs-websphere","owner":{"login":"bFekete","id":8890410,"avatar_url":"https://avatars.githubusercontent.com/u/8890410?v=3","gravatar_id":"","url":"https://api.github.com/users/bFekete","html_url":"https://github.com/bFekete","followers_url":"https://api.github.com/users/bFekete/followers","following_url":"https://api.github.com/users/bFekete/following{/other_user}","gists_url":"https://api.github.com/users/bFekete/gists{/gist_id}","starred_url":"https://api.github.com/users/bFekete/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bFekete/subscriptions","organizations_url":"https://api.github.com/users/bFekete/orgs","repos_url":"https://api.github.com/users/bFekete/repos","events_url":"https://api.github.com/users/bFekete/events{/privacy}","received_events_url":"https://api.github.com/users/bFekete/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bFekete/puppetlabs-websphere","description":"Puppet module for managing IBM WebSphere Network Deployment","fork":true,"url":"https://api.github.com/repos/bFekete/puppetlabs-websphere","forks_url":"https://api.github.com/repos/bFekete/puppetlabs-websphere/forks","keys_url":"https://api.github.com/repos/bFekete/puppetlabs-websphere/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bFekete/puppetlabs-websphere/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bFekete/puppetlabs-websphere/teams","hooks_url":"https://api.github.com/repos/bFekete/puppetlabs-websphere/hooks","issue_events_url":"https://api.github.com/repos/bFekete/puppetlabs-websphere/issues/events{/number}","events_url":"https://api.github.com/repos/bFekete/puppetlabs-websphere/events","assignees_url":"https://api.github.com/repos/bFekete/puppetlabs-websphere/assignees{/user}","branches_url":"https://api.github.com/repos/bFekete/puppetlabs-websphere/branches{/branch}","tags_url":"https://api.github.com/repos/bFekete/puppetlabs-websphere/tags","blobs_url":"https://api.github.com/repos/bFekete/puppetlabs-websphere/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bFekete/puppetlabs-websphere/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bFekete/puppetlabs-websphere/git/refs{/sha}","trees_url":"https://api.github.com/repos/bFekete/puppetlabs-websphere/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bFekete/puppetlabs-websphere/statuses/{sha}","languages_url":"https://api.github.com/repos/bFekete/puppetlabs-websphere/languages","stargazers_url":"https://api.github.com/repos/bFekete/puppetlabs-websphere/stargazers","contributors_url":"https://api.github.com/repos/bFekete/puppetlabs-websphere/contributors","subscribers_url":"https://api.github.com/repos/bFekete/puppetlabs-websphere/subscribers","subscription_url":"https://api.github.com/repos/bFekete/puppetlabs-websphere/subscription","commits_url":"https://api.github.com/repos/bFekete/puppetlabs-websphere/commits{/sha}","git_commits_url":"https://api.github.com/repos/bFekete/puppetlabs-websphere/git/commits{/sha}","comments_url":"https://api.github.com/repos/bFekete/puppetlabs-websphere/comments{/number}","issue_comment_url":"https://api.github.com/repos/bFekete/puppetlabs-websphere/issues/comments{/number}","contents_url":"https://api.github.com/repos/bFekete/puppetlabs-websphere/contents/{+path}","compare_url":"https://api.github.com/repos/bFekete/puppetlabs-websphere/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bFekete/puppetlabs-websphere/merges","archive_url":"https://api.github.com/repos/bFekete/puppetlabs-websphere/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bFekete/puppetlabs-websphere/downloads","issues_url":"https://api.github.com/repos/bFekete/puppetlabs-websphere/issues{/number}","pulls_url":"https://api.github.com/repos/bFekete/puppetlabs-websphere/pulls{/number}","milestones_url":"https://api.github.com/repos/bFekete/puppetlabs-websphere/milestones{/number}","notifications_url":"https://api.github.com/repos/bFekete/puppetlabs-websphere/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bFekete/puppetlabs-websphere/labels{/name}","releases_url":"https://api.github.com/repos/bFekete/puppetlabs-websphere/releases{/id}","created_at":"2015-07-27T12:26:00Z","updated_at":"2015-07-27T12:26:01Z","pushed_at":"2015-08-15T10:20:43Z","git_url":"git://github.com/bFekete/puppetlabs-websphere.git","ssh_url":"git@github.com:bFekete/puppetlabs-websphere.git","clone_url":"https://github.com/bFekete/puppetlabs-websphere.git","svn_url":"https://github.com/bFekete/puppetlabs-websphere","homepage":null,"size":350,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"puppetlabs:0.x","ref":"0.x","sha":"83b20f20cd276c3a5b06b37a79afe9fe10aa4d09","user":{"login":"puppetlabs","id":234268,"avatar_url":"https://avatars.githubusercontent.com/u/234268?v=3","gravatar_id":"","url":"https://api.github.com/users/puppetlabs","html_url":"https://github.com/puppetlabs","followers_url":"https://api.github.com/users/puppetlabs/followers","following_url":"https://api.github.com/users/puppetlabs/following{/other_user}","gists_url":"https://api.github.com/users/puppetlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/puppetlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/puppetlabs/subscriptions","organizations_url":"https://api.github.com/users/puppetlabs/orgs","repos_url":"https://api.github.com/users/puppetlabs/repos","events_url":"https://api.github.com/users/puppetlabs/events{/privacy}","received_events_url":"https://api.github.com/users/puppetlabs/received_events","type":"Organization","site_admin":false},"repo":{"id":30674171,"name":"puppetlabs-websphere","full_name":"puppetlabs/puppetlabs-websphere","owner":{"login":"puppetlabs","id":234268,"avatar_url":"https://avatars.githubusercontent.com/u/234268?v=3","gravatar_id":"","url":"https://api.github.com/users/puppetlabs","html_url":"https://github.com/puppetlabs","followers_url":"https://api.github.com/users/puppetlabs/followers","following_url":"https://api.github.com/users/puppetlabs/following{/other_user}","gists_url":"https://api.github.com/users/puppetlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/puppetlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/puppetlabs/subscriptions","organizations_url":"https://api.github.com/users/puppetlabs/orgs","repos_url":"https://api.github.com/users/puppetlabs/repos","events_url":"https://api.github.com/users/puppetlabs/events{/privacy}","received_events_url":"https://api.github.com/users/puppetlabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/puppetlabs/puppetlabs-websphere","description":"Puppet module for managing IBM WebSphere Network Deployment","fork":false,"url":"https://api.github.com/repos/puppetlabs/puppetlabs-websphere","forks_url":"https://api.github.com/repos/puppetlabs/puppetlabs-websphere/forks","keys_url":"https://api.github.com/repos/puppetlabs/puppetlabs-websphere/keys{/key_id}","collaborators_url":"https://api.github.com/repos/puppetlabs/puppetlabs-websphere/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/puppetlabs/puppetlabs-websphere/teams","hooks_url":"https://api.github.com/repos/puppetlabs/puppetlabs-websphere/hooks","issue_events_url":"https://api.github.com/repos/puppetlabs/puppetlabs-websphere/issues/events{/number}","events_url":"https://api.github.com/repos/puppetlabs/puppetlabs-websphere/events","assignees_url":"https://api.github.com/repos/puppetlabs/puppetlabs-websphere/assignees{/user}","branches_url":"https://api.github.com/repos/puppetlabs/puppetlabs-websphere/branches{/branch}","tags_url":"https://api.github.com/repos/puppetlabs/puppetlabs-websphere/tags","blobs_url":"https://api.github.com/repos/puppetlabs/puppetlabs-websphere/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/puppetlabs/puppetlabs-websphere/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/puppetlabs/puppetlabs-websphere/git/refs{/sha}","trees_url":"https://api.github.com/repos/puppetlabs/puppetlabs-websphere/git/trees{/sha}","statuses_url":"https://api.github.com/repos/puppetlabs/puppetlabs-websphere/statuses/{sha}","languages_url":"https://api.github.com/repos/puppetlabs/puppetlabs-websphere/languages","stargazers_url":"https://api.github.com/repos/puppetlabs/puppetlabs-websphere/stargazers","contributors_url":"https://api.github.com/repos/puppetlabs/puppetlabs-websphere/contributors","subscribers_url":"https://api.github.com/repos/puppetlabs/puppetlabs-websphere/subscribers","subscription_url":"https://api.github.com/repos/puppetlabs/puppetlabs-websphere/subscription","commits_url":"https://api.github.com/repos/puppetlabs/puppetlabs-websphere/commits{/sha}","git_commits_url":"https://api.github.com/repos/puppetlabs/puppetlabs-websphere/git/commits{/sha}","comments_url":"https://api.github.com/repos/puppetlabs/puppetlabs-websphere/comments{/number}","issue_comment_url":"https://api.github.com/repos/puppetlabs/puppetlabs-websphere/issues/comments{/number}","contents_url":"https://api.github.com/repos/puppetlabs/puppetlabs-websphere/contents/{+path}","compare_url":"https://api.github.com/repos/puppetlabs/puppetlabs-websphere/compare/{base}...{head}","merges_url":"https://api.github.com/repos/puppetlabs/puppetlabs-websphere/merges","archive_url":"https://api.github.com/repos/puppetlabs/puppetlabs-websphere/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/puppetlabs/puppetlabs-websphere/downloads","issues_url":"https://api.github.com/repos/puppetlabs/puppetlabs-websphere/issues{/number}","pulls_url":"https://api.github.com/repos/puppetlabs/puppetlabs-websphere/pulls{/number}","milestones_url":"https://api.github.com/repos/puppetlabs/puppetlabs-websphere/milestones{/number}","notifications_url":"https://api.github.com/repos/puppetlabs/puppetlabs-websphere/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/puppetlabs/puppetlabs-websphere/labels{/name}","releases_url":"https://api.github.com/repos/puppetlabs/puppetlabs-websphere/releases{/id}","created_at":"2015-02-11T22:55:27Z","updated_at":"2015-07-14T12:41:20Z","pushed_at":"2015-08-15T10:27:06Z","git_url":"git://github.com/puppetlabs/puppetlabs-websphere.git","ssh_url":"git@github.com:puppetlabs/puppetlabs-websphere.git","clone_url":"https://github.com/puppetlabs/puppetlabs-websphere.git","svn_url":"https://github.com/puppetlabs/puppetlabs-websphere","homepage":null,"size":423,"stargazers_count":5,"watchers_count":5,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":10,"mirror_url":null,"open_issues_count":5,"forks":10,"open_issues":5,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/puppetlabs/puppetlabs-websphere/pulls/8"},"html":{"href":"https://github.com/puppetlabs/puppetlabs-websphere/pull/8"},"issue":{"href":"https://api.github.com/repos/puppetlabs/puppetlabs-websphere/issues/8"},"comments":{"href":"https://api.github.com/repos/puppetlabs/puppetlabs-websphere/issues/8/comments"},"review_comments":{"href":"https://api.github.com/repos/puppetlabs/puppetlabs-websphere/pulls/8/comments"},"review_comment":{"href":"https://api.github.com/repos/puppetlabs/puppetlabs-websphere/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/puppetlabs/puppetlabs-websphere/pulls/8/commits"},"statuses":{"href":"https://api.github.com/repos/puppetlabs/puppetlabs-websphere/statuses/afa289ae4c4a571149e47f099caa70fcc031af20"}}}}