{"action":"created","issue":{"url":"https://api.github.com/repos/ManageIQ/manageiq/issues/1376","labels_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/1376/labels{/name}","comments_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/1376/comments","events_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/1376/events","html_url":"https://github.com/ManageIQ/manageiq/pull/1376","id":54407550,"number":1376,"title":"Nil save inventory 3","user":{"login":"kbrock","id":1930,"avatar_url":"https://avatars.githubusercontent.com/u/1930?v=3","gravatar_id":"","url":"https://api.github.com/users/kbrock","html_url":"https://github.com/kbrock","followers_url":"https://api.github.com/users/kbrock/followers","following_url":"https://api.github.com/users/kbrock/following{/other_user}","gists_url":"https://api.github.com/users/kbrock/gists{/gist_id}","starred_url":"https://api.github.com/users/kbrock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kbrock/subscriptions","organizations_url":"https://api.github.com/users/kbrock/orgs","repos_url":"https://api.github.com/users/kbrock/repos","events_url":"https://api.github.com/users/kbrock/events{/privacy}","received_events_url":"https://api.github.com/users/kbrock/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ManageIQ/manageiq/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/ManageIQ/manageiq/labels/providers","name":"providers","color":"5319e7"},{"url":"https://api.github.com/repos/ManageIQ/manageiq/labels/refactoring","name":"refactoring","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-01-15T03:08:08Z","updated_at":"2015-03-06T19:28:46Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/1376","html_url":"https://github.com/ManageIQ/manageiq/pull/1376","diff_url":"https://github.com/ManageIQ/manageiq/pull/1376.diff","patch_url":"https://github.com/ManageIQ/manageiq/pull/1376.patch"},"body":"We are no longer calling save inventory methods for nil hashes.\r\n\r\nnetwork used to delete a network for a nil hash coming in.\r\nSince they are no longer coming in, they would not get deleted.\r\n\r\nNow we're passing in a blank.\r\nBusiness back to usual.\r\n\r\n(MiqScvmmInventory: found while searching wasn't worth pulling out into own pr)\r\n\r\n/cc @Fryguy @gmcculloug @brandondunne "},"comment":{"url":"https://api.github.com/repos/ManageIQ/manageiq/issues/comments/77620135","html_url":"https://github.com/ManageIQ/manageiq/pull/1376#issuecomment-77620135","issue_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/1376","id":77620135,"user":{"login":"Fryguy","id":52120,"avatar_url":"https://avatars.githubusercontent.com/u/52120?v=3","gravatar_id":"","url":"https://api.github.com/users/Fryguy","html_url":"https://github.com/Fryguy","followers_url":"https://api.github.com/users/Fryguy/followers","following_url":"https://api.github.com/users/Fryguy/following{/other_user}","gists_url":"https://api.github.com/users/Fryguy/gists{/gist_id}","starred_url":"https://api.github.com/users/Fryguy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fryguy/subscriptions","organizations_url":"https://api.github.com/users/Fryguy/orgs","repos_url":"https://api.github.com/users/Fryguy/repos","events_url":"https://api.github.com/users/Fryguy/events{/privacy}","received_events_url":"https://api.github.com/users/Fryguy/received_events","type":"User","site_admin":false},"created_at":"2015-03-06T19:28:46Z","updated_at":"2015-03-06T19:28:46Z","body":"So, spoke with @kbrock and we came to a consensus.  First off, the impetus behind the changes in this PR was a perceived bug in saving `guest_device.network`, but we realized that was unfounded.  However there are inconsistencies in the save_inventory code, so we wrote up a chart to verify what we expect from the parser writer's perspective and to narrow down where the bugs might *actually* be.  Note that we think that all of the inconsistencies fall into the \"questionable usage\" category and/or are never being exercised.  However, if a parser writer *were* to ever write code that way, then the expectations would not be met, and there'd be a lot of head scratching and bug searching.\r\n\r\n**has_many**\r\n\r\n| hash | expected operation | actual operation | notes |\r\n| --- | --- | --- | --- |\r\n| *key missing* | ignore | ignore |\r\n| `:disks => []` | delete | delete |\r\n| `:disks => nil` | delete | **ignore** | questionable usage\r\n| `:disks => [h1, h2]` | add/update | add/update\r\n\r\n**has_one**\r\n\r\n| hash | expected operation | actual operation | notes |\r\n| --- | --- | --- | --- |\r\n| *key missing* | ignore | ignore |\r\n| `:hardware => {}` | delete | **delete? but possibly ignore?** | questionable usage\r\n| `:hardware => nil` | delete | **delete for network / ignore for others** | bug, but never exercised by \"others\"\r\n| `:hardware => [h1, h2]` | add/update | add/update\r\n"}}