{"action":"created","comment":{"url":"https://api.github.com/repos/jclouds/jclouds/pulls/comments/30147104","id":30147104,"diff_hunk":"@@ -0,0 +1,65 @@\n+/*\n+ * Licensed to the Apache Software Foundation (ASF) under one or more\n+ * contributor license agreements.  See the NOTICE file distributed with\n+ * this work for additional information regarding copyright ownership.\n+ * The ASF licenses this file to You under the Apache License, Version 2.0\n+ * (the \"License\"); you may not use this file except in compliance with\n+ * the License.  You may obtain a copy of the License at\n+ *\n+ *     http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+package org.jclouds.softlayer.domain;\n+\n+import static org.testng.Assert.assertTrue;\n+\n+import java.util.Set;\n+\n+import org.testng.annotations.Test;\n+\n+import com.google.common.collect.ImmutableSet;\n+\n+@Test(singleThreaded = true, groups = \"unit\")\n+public class ContainerVirtualGuestConfigurationTest {\n+   @Test\n+   public void testGetVirtualGuestOperatingSystemsWithMissingReferenceCode() {\n+      // Malformed response leading to failure:\n+      // {\n+      //    \"itemPrice\": {\n+      //        \"hourlyRecurringFee\": \".131\",\n+      //        \"item\": {\n+      //            \"description\": \"Windows Server 2012 Datacenter Edition (64bit)\"\n+      //        },\n+      //        \"recurringFee\": \"90.63\"\n+      //    },\n+      //    \"template\": {\n+      //        \"id\": null\n+      //        missing operatingSystemReferenceCode entry!\n+      //    }\n+      // },\n+\n+      ContainerVirtualGuestConfigurationOption os = ContainerVirtualGuestConfigurationOption.builder()\n+         .productItemPrice(ProductItemPrice.builder()\n+                 .hourlyRecurringFee(0.131f)\n+                 .recurringFee(\"90.63\")\n+                 .item(ProductItem.builder().description(\"Windows Server 2012 Datacenter Edition (64bit)\").build())\n+                 .build())\n+         .template(VirtualGuest.builder().build())\n+         .build();\n+      ContainerVirtualGuestConfiguration conf = ContainerVirtualGuestConfiguration.builder()\n+         .blockDevices(ImmutableSet.<ContainerVirtualGuestConfigurationOption>of())\n+         .datacenters(ImmutableSet.<ContainerVirtualGuestConfigurationOption>of())\n+         .memory(ImmutableSet.<ContainerVirtualGuestConfigurationOption>of())\n+         .networkComponents(ImmutableSet.<ContainerVirtualGuestConfigurationOption>of())\n+         .operatingSystems(ImmutableSet.<ContainerVirtualGuestConfigurationOption>of(os))","path":"providers/softlayer/src/test/java/org/jclouds/softlayer/domain/ContainerVirtualGuestConfigurationTest.java","position":59,"original_position":59,"commit_id":"3db4c6264baf0eb298c05b953bcd776a03f0a7b5","original_commit_id":"3db4c6264baf0eb298c05b953bcd776a03f0a7b5","user":{"login":"nacx","id":446705,"avatar_url":"https://avatars.githubusercontent.com/u/446705?v=3","gravatar_id":"","url":"https://api.github.com/users/nacx","html_url":"https://github.com/nacx","followers_url":"https://api.github.com/users/nacx/followers","following_url":"https://api.github.com/users/nacx/following{/other_user}","gists_url":"https://api.github.com/users/nacx/gists{/gist_id}","starred_url":"https://api.github.com/users/nacx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nacx/subscriptions","organizations_url":"https://api.github.com/users/nacx/orgs","repos_url":"https://api.github.com/users/nacx/repos","events_url":"https://api.github.com/users/nacx/events{/privacy}","received_events_url":"https://api.github.com/users/nacx/received_events","type":"User","site_admin":false},"body":"Add another OS to the set, just to verify that only the right ones are ignored.","created_at":"2015-05-12T15:38:43Z","updated_at":"2015-05-12T15:38:43Z","html_url":"https://github.com/jclouds/jclouds/pull/743#discussion_r30147104","pull_request_url":"https://api.github.com/repos/jclouds/jclouds/pulls/743","_links":{"self":{"href":"https://api.github.com/repos/jclouds/jclouds/pulls/comments/30147104"},"html":{"href":"https://github.com/jclouds/jclouds/pull/743#discussion_r30147104"},"pull_request":{"href":"https://api.github.com/repos/jclouds/jclouds/pulls/743"}}},"pull_request":{"url":"https://api.github.com/repos/jclouds/jclouds/pulls/743","id":35139695,"html_url":"https://github.com/jclouds/jclouds/pull/743","diff_url":"https://github.com/jclouds/jclouds/pull/743.diff","patch_url":"https://github.com/jclouds/jclouds/pull/743.patch","issue_url":"https://api.github.com/repos/jclouds/jclouds/issues/743","number":743,"state":"open","locked":false,"title":"Skip malformed image entries returned by Softlayer","user":{"login":"neykov","id":3612111,"avatar_url":"https://avatars.githubusercontent.com/u/3612111?v=3","gravatar_id":"","url":"https://api.github.com/users/neykov","html_url":"https://github.com/neykov","followers_url":"https://api.github.com/users/neykov/followers","following_url":"https://api.github.com/users/neykov/following{/other_user}","gists_url":"https://api.github.com/users/neykov/gists{/gist_id}","starred_url":"https://api.github.com/users/neykov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neykov/subscriptions","organizations_url":"https://api.github.com/users/neykov/orgs","repos_url":"https://api.github.com/users/neykov/repos","events_url":"https://api.github.com/users/neykov/events{/privacy}","received_events_url":"https://api.github.com/users/neykov/received_events","type":"User","site_admin":false},"body":"Softlayer will occasionally return an incomplete operating system template entry in the `/SoftLayer_Virtual_Guest/getCreateObjectOptions` call, making it impossible to spin up machines - ignore the incomplete entries which are usually not even relevant.\r\n\r\nSnippet of incomplete response in `operatingSystems` array\r\n\r\n```\r\n         {\r\n            \"itemPrice\": {\r\n                \"hourlyRecurringFee\": \".131\",\r\n                \"item\": {\r\n                    \"description\": \"Windows Server 2012 Datacenter Edition (64bit)\"\r\n                },\r\n                \"recurringFee\": \"90.63\"\r\n            },\r\n            \"template\": {\r\n                \"id\": null\r\n            }\r\n        },\r\n```","created_at":"2015-05-11T15:40:32Z","updated_at":"2015-05-12T15:38:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b43e870ff8c7edebfa53aa70703b5b94b419a99c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/jclouds/jclouds/pulls/743/commits","review_comments_url":"https://api.github.com/repos/jclouds/jclouds/pulls/743/comments","review_comment_url":"https://api.github.com/repos/jclouds/jclouds/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jclouds/jclouds/issues/743/comments","statuses_url":"https://api.github.com/repos/jclouds/jclouds/statuses/3db4c6264baf0eb298c05b953bcd776a03f0a7b5","head":{"label":"neykov:sl-incomplete-os-template","ref":"sl-incomplete-os-template","sha":"3db4c6264baf0eb298c05b953bcd776a03f0a7b5","user":{"login":"neykov","id":3612111,"avatar_url":"https://avatars.githubusercontent.com/u/3612111?v=3","gravatar_id":"","url":"https://api.github.com/users/neykov","html_url":"https://github.com/neykov","followers_url":"https://api.github.com/users/neykov/followers","following_url":"https://api.github.com/users/neykov/following{/other_user}","gists_url":"https://api.github.com/users/neykov/gists{/gist_id}","starred_url":"https://api.github.com/users/neykov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neykov/subscriptions","organizations_url":"https://api.github.com/users/neykov/orgs","repos_url":"https://api.github.com/users/neykov/repos","events_url":"https://api.github.com/users/neykov/events{/privacy}","received_events_url":"https://api.github.com/users/neykov/received_events","type":"User","site_admin":false},"repo":{"id":35432804,"name":"jclouds","full_name":"neykov/jclouds","owner":{"login":"neykov","id":3612111,"avatar_url":"https://avatars.githubusercontent.com/u/3612111?v=3","gravatar_id":"","url":"https://api.github.com/users/neykov","html_url":"https://github.com/neykov","followers_url":"https://api.github.com/users/neykov/followers","following_url":"https://api.github.com/users/neykov/following{/other_user}","gists_url":"https://api.github.com/users/neykov/gists{/gist_id}","starred_url":"https://api.github.com/users/neykov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neykov/subscriptions","organizations_url":"https://api.github.com/users/neykov/orgs","repos_url":"https://api.github.com/users/neykov/repos","events_url":"https://api.github.com/users/neykov/events{/privacy}","received_events_url":"https://api.github.com/users/neykov/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/neykov/jclouds","description":"Read-only mirror of ASF Git Repo for jclouds","fork":true,"url":"https://api.github.com/repos/neykov/jclouds","forks_url":"https://api.github.com/repos/neykov/jclouds/forks","keys_url":"https://api.github.com/repos/neykov/jclouds/keys{/key_id}","collaborators_url":"https://api.github.com/repos/neykov/jclouds/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/neykov/jclouds/teams","hooks_url":"https://api.github.com/repos/neykov/jclouds/hooks","issue_events_url":"https://api.github.com/repos/neykov/jclouds/issues/events{/number}","events_url":"https://api.github.com/repos/neykov/jclouds/events","assignees_url":"https://api.github.com/repos/neykov/jclouds/assignees{/user}","branches_url":"https://api.github.com/repos/neykov/jclouds/branches{/branch}","tags_url":"https://api.github.com/repos/neykov/jclouds/tags","blobs_url":"https://api.github.com/repos/neykov/jclouds/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/neykov/jclouds/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/neykov/jclouds/git/refs{/sha}","trees_url":"https://api.github.com/repos/neykov/jclouds/git/trees{/sha}","statuses_url":"https://api.github.com/repos/neykov/jclouds/statuses/{sha}","languages_url":"https://api.github.com/repos/neykov/jclouds/languages","stargazers_url":"https://api.github.com/repos/neykov/jclouds/stargazers","contributors_url":"https://api.github.com/repos/neykov/jclouds/contributors","subscribers_url":"https://api.github.com/repos/neykov/jclouds/subscribers","subscription_url":"https://api.github.com/repos/neykov/jclouds/subscription","commits_url":"https://api.github.com/repos/neykov/jclouds/commits{/sha}","git_commits_url":"https://api.github.com/repos/neykov/jclouds/git/commits{/sha}","comments_url":"https://api.github.com/repos/neykov/jclouds/comments{/number}","issue_comment_url":"https://api.github.com/repos/neykov/jclouds/issues/comments{/number}","contents_url":"https://api.github.com/repos/neykov/jclouds/contents/{+path}","compare_url":"https://api.github.com/repos/neykov/jclouds/compare/{base}...{head}","merges_url":"https://api.github.com/repos/neykov/jclouds/merges","archive_url":"https://api.github.com/repos/neykov/jclouds/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/neykov/jclouds/downloads","issues_url":"https://api.github.com/repos/neykov/jclouds/issues{/number}","pulls_url":"https://api.github.com/repos/neykov/jclouds/pulls{/number}","milestones_url":"https://api.github.com/repos/neykov/jclouds/milestones{/number}","notifications_url":"https://api.github.com/repos/neykov/jclouds/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/neykov/jclouds/labels{/name}","releases_url":"https://api.github.com/repos/neykov/jclouds/releases{/id}","created_at":"2015-05-11T15:34:18Z","updated_at":"2015-05-11T15:34:33Z","pushed_at":"2015-05-12T11:15:59Z","git_url":"git://github.com/neykov/jclouds.git","ssh_url":"git@github.com:neykov/jclouds.git","clone_url":"https://github.com/neykov/jclouds.git","svn_url":"https://github.com/neykov/jclouds","homepage":"http://jclouds.apache.org/","size":173675,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"jclouds:master","ref":"master","sha":"2c53ef38a5caf5621fcf74983636fbd00341a674","user":{"login":"jclouds","id":108982,"avatar_url":"https://avatars.githubusercontent.com/u/108982?v=3","gravatar_id":"","url":"https://api.github.com/users/jclouds","html_url":"https://github.com/jclouds","followers_url":"https://api.github.com/users/jclouds/followers","following_url":"https://api.github.com/users/jclouds/following{/other_user}","gists_url":"https://api.github.com/users/jclouds/gists{/gist_id}","starred_url":"https://api.github.com/users/jclouds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jclouds/subscriptions","organizations_url":"https://api.github.com/users/jclouds/orgs","repos_url":"https://api.github.com/users/jclouds/repos","events_url":"https://api.github.com/users/jclouds/events{/privacy}","received_events_url":"https://api.github.com/users/jclouds/received_events","type":"Organization","site_admin":false},"repo":{"id":10040960,"name":"jclouds","full_name":"jclouds/jclouds","owner":{"login":"jclouds","id":108982,"avatar_url":"https://avatars.githubusercontent.com/u/108982?v=3","gravatar_id":"","url":"https://api.github.com/users/jclouds","html_url":"https://github.com/jclouds","followers_url":"https://api.github.com/users/jclouds/followers","following_url":"https://api.github.com/users/jclouds/following{/other_user}","gists_url":"https://api.github.com/users/jclouds/gists{/gist_id}","starred_url":"https://api.github.com/users/jclouds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jclouds/subscriptions","organizations_url":"https://api.github.com/users/jclouds/orgs","repos_url":"https://api.github.com/users/jclouds/repos","events_url":"https://api.github.com/users/jclouds/events{/privacy}","received_events_url":"https://api.github.com/users/jclouds/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/jclouds/jclouds","description":"Read-only mirror of ASF Git Repo for jclouds","fork":false,"url":"https://api.github.com/repos/jclouds/jclouds","forks_url":"https://api.github.com/repos/jclouds/jclouds/forks","keys_url":"https://api.github.com/repos/jclouds/jclouds/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jclouds/jclouds/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jclouds/jclouds/teams","hooks_url":"https://api.github.com/repos/jclouds/jclouds/hooks","issue_events_url":"https://api.github.com/repos/jclouds/jclouds/issues/events{/number}","events_url":"https://api.github.com/repos/jclouds/jclouds/events","assignees_url":"https://api.github.com/repos/jclouds/jclouds/assignees{/user}","branches_url":"https://api.github.com/repos/jclouds/jclouds/branches{/branch}","tags_url":"https://api.github.com/repos/jclouds/jclouds/tags","blobs_url":"https://api.github.com/repos/jclouds/jclouds/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jclouds/jclouds/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jclouds/jclouds/git/refs{/sha}","trees_url":"https://api.github.com/repos/jclouds/jclouds/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jclouds/jclouds/statuses/{sha}","languages_url":"https://api.github.com/repos/jclouds/jclouds/languages","stargazers_url":"https://api.github.com/repos/jclouds/jclouds/stargazers","contributors_url":"https://api.github.com/repos/jclouds/jclouds/contributors","subscribers_url":"https://api.github.com/repos/jclouds/jclouds/subscribers","subscription_url":"https://api.github.com/repos/jclouds/jclouds/subscription","commits_url":"https://api.github.com/repos/jclouds/jclouds/commits{/sha}","git_commits_url":"https://api.github.com/repos/jclouds/jclouds/git/commits{/sha}","comments_url":"https://api.github.com/repos/jclouds/jclouds/comments{/number}","issue_comment_url":"https://api.github.com/repos/jclouds/jclouds/issues/comments{/number}","contents_url":"https://api.github.com/repos/jclouds/jclouds/contents/{+path}","compare_url":"https://api.github.com/repos/jclouds/jclouds/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jclouds/jclouds/merges","archive_url":"https://api.github.com/repos/jclouds/jclouds/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jclouds/jclouds/downloads","issues_url":"https://api.github.com/repos/jclouds/jclouds/issues{/number}","pulls_url":"https://api.github.com/repos/jclouds/jclouds/pulls{/number}","milestones_url":"https://api.github.com/repos/jclouds/jclouds/milestones{/number}","notifications_url":"https://api.github.com/repos/jclouds/jclouds/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jclouds/jclouds/labels{/name}","releases_url":"https://api.github.com/repos/jclouds/jclouds/releases{/id}","created_at":"2013-05-13T20:47:29Z","updated_at":"2015-05-11T05:54:57Z","pushed_at":"2015-05-12T11:16:00Z","git_url":"git://github.com/jclouds/jclouds.git","ssh_url":"git@github.com:jclouds/jclouds.git","clone_url":"https://github.com/jclouds/jclouds.git","svn_url":"https://github.com/jclouds/jclouds","homepage":"http://jclouds.apache.org/","size":173675,"stargazers_count":171,"watchers_count":171,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":261,"mirror_url":null,"open_issues_count":20,"forks":261,"open_issues":20,"watchers":171,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jclouds/jclouds/pulls/743"},"html":{"href":"https://github.com/jclouds/jclouds/pull/743"},"issue":{"href":"https://api.github.com/repos/jclouds/jclouds/issues/743"},"comments":{"href":"https://api.github.com/repos/jclouds/jclouds/issues/743/comments"},"review_comments":{"href":"https://api.github.com/repos/jclouds/jclouds/pulls/743/comments"},"review_comment":{"href":"https://api.github.com/repos/jclouds/jclouds/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jclouds/jclouds/pulls/743/commits"},"statuses":{"href":"https://api.github.com/repos/jclouds/jclouds/statuses/3db4c6264baf0eb298c05b953bcd776a03f0a7b5"}}}}