{"action":"created","comment":{"url":"https://api.github.com/repos/SatelliteQE/robottelo/pulls/comments/67495957","id":67495957,"diff_hunk":"@@ -35,25 +37,42 @@ class HostCollection(Base):\n     command_base = 'host-collection'\n \n     @classmethod\n+    def transform_ids(cls, options=None):\n+        \"\"\"Workaround host unification feature not being completed to use host\n+        id instead content host uuid","path":"robottelo/cli/hostcollection.py","position":15,"original_position":15,"commit_id":"afc90176cb206b27583eb3c2bedc2fb8008747b0","original_commit_id":"afc90176cb206b27583eb3c2bedc2fb8008747b0","user":{"login":"abalakh","id":11719030,"avatar_url":"https://avatars.githubusercontent.com/u/11719030?v=3","gravatar_id":"","url":"https://api.github.com/users/abalakh","html_url":"https://github.com/abalakh","followers_url":"https://api.github.com/users/abalakh/followers","following_url":"https://api.github.com/users/abalakh/following{/other_user}","gists_url":"https://api.github.com/users/abalakh/gists{/gist_id}","starred_url":"https://api.github.com/users/abalakh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abalakh/subscriptions","organizations_url":"https://api.github.com/users/abalakh/orgs","repos_url":"https://api.github.com/users/abalakh/repos","events_url":"https://api.github.com/users/abalakh/events{/privacy}","received_events_url":"https://api.github.com/users/abalakh/received_events","type":"User","site_admin":false},"body":"The only thing i'm not sure about is your approach - basically if list of uuids is send then it will transform it into ids, if ids passed - then it will pass it as it is. But when list contains both uuids and ids (i can barely image that, but maybe we'll have some big end to end scenario, where list of hosts will be gathered through the test and at some point user will accidentaly collect both uuids and ids in the same list... yeah, not a big chance of that), in such case this func will ignore all the ids and pass only transformed uuids, which is bad and hard to debug why...\r\nWe could go smarter and work with any kind of list, for example like that:\r\n```python\r\nhost_ids = []\r\nfor host_id in options.get('host-ids').split(','):\r\n    host_ids.append(\r\n        host_id if host_id.is_numeric() else \r\n        Host.info({\r\n            'name': ContentHost.info({'id': host_id})['name'].lower()\r\n        })['id']\r\n    )\r\nif host_ids:\r\n    options['host-ids'] = ','.join(host_ids)\r\n```\r\nNot sure if that worth it though as the chance of failure is pretty low, but on the other hand why should we leave hidden bug here?","created_at":"2016-06-17T11:23:06Z","updated_at":"2016-06-17T11:23:06Z","html_url":"https://github.com/SatelliteQE/robottelo/pull/3542#discussion_r67495957","pull_request_url":"https://api.github.com/repos/SatelliteQE/robottelo/pulls/3542","_links":{"self":{"href":"https://api.github.com/repos/SatelliteQE/robottelo/pulls/comments/67495957"},"html":{"href":"https://github.com/SatelliteQE/robottelo/pull/3542#discussion_r67495957"},"pull_request":{"href":"https://api.github.com/repos/SatelliteQE/robottelo/pulls/3542"}}},"pull_request":{"url":"https://api.github.com/repos/SatelliteQE/robottelo/pulls/3542","id":73725934,"html_url":"https://github.com/SatelliteQE/robottelo/pull/3542","diff_url":"https://github.com/SatelliteQE/robottelo/pull/3542.diff","patch_url":"https://github.com/SatelliteQE/robottelo/pull/3542.patch","issue_url":"https://api.github.com/repos/SatelliteQE/robottelo/issues/3542","number":3542,"state":"open","locked":false,"title":"Fix host collection test cases according to host unification feature","user":{"login":"oshtaier","id":10895065,"avatar_url":"https://avatars.githubusercontent.com/u/10895065?v=3","gravatar_id":"","url":"https://api.github.com/users/oshtaier","html_url":"https://github.com/oshtaier","followers_url":"https://api.github.com/users/oshtaier/followers","following_url":"https://api.github.com/users/oshtaier/following{/other_user}","gists_url":"https://api.github.com/users/oshtaier/gists{/gist_id}","starred_url":"https://api.github.com/users/oshtaier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oshtaier/subscriptions","organizations_url":"https://api.github.com/users/oshtaier/orgs","repos_url":"https://api.github.com/users/oshtaier/repos","events_url":"https://api.github.com/users/oshtaier/events{/privacy}","received_events_url":"https://api.github.com/users/oshtaier/received_events","type":"User","site_admin":false},"body":"Thanks @abalakh for productive discussion\r\n```\r\nnosetests tests/foreman/cli/test_host_collection.py -m test_positive_add_host_by_id\r\n.\r\n----------------------------------------------------------------------\r\nRan 1 test in 112.280s\r\n\r\nOK\r\n```\r\n```\r\nnosetests tests/foreman/cli/test_host_collection.py -m test_positive_remove_host_by_id\r\n.\r\n----------------------------------------------------------------------\r\nRan 1 test in 147.480s\r\n\r\nOK\r\n```\r\n```\r\nnosetests tests/foreman/cli/test_host_collection.py -m test_positive_list_hosts\r\nS\r\n----------------------------------------------------------------------\r\nRan 1 test in 66.800s\r\n\r\nOK (SKIP=1)\r\n```","created_at":"2016-06-14T11:52:19Z","updated_at":"2016-06-17T11:23:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"35b77f717c0f77e3e19027b1e11501912631a4fc","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/SatelliteQE/robottelo/pulls/3542/commits","review_comments_url":"https://api.github.com/repos/SatelliteQE/robottelo/pulls/3542/comments","review_comment_url":"https://api.github.com/repos/SatelliteQE/robottelo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/SatelliteQE/robottelo/issues/3542/comments","statuses_url":"https://api.github.com/repos/SatelliteQE/robottelo/statuses/afc90176cb206b27583eb3c2bedc2fb8008747b0","head":{"label":"oshtaier:cli_host_collection","ref":"cli_host_collection","sha":"afc90176cb206b27583eb3c2bedc2fb8008747b0","user":{"login":"oshtaier","id":10895065,"avatar_url":"https://avatars.githubusercontent.com/u/10895065?v=3","gravatar_id":"","url":"https://api.github.com/users/oshtaier","html_url":"https://github.com/oshtaier","followers_url":"https://api.github.com/users/oshtaier/followers","following_url":"https://api.github.com/users/oshtaier/following{/other_user}","gists_url":"https://api.github.com/users/oshtaier/gists{/gist_id}","starred_url":"https://api.github.com/users/oshtaier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oshtaier/subscriptions","organizations_url":"https://api.github.com/users/oshtaier/orgs","repos_url":"https://api.github.com/users/oshtaier/repos","events_url":"https://api.github.com/users/oshtaier/events{/privacy}","received_events_url":"https://api.github.com/users/oshtaier/received_events","type":"User","site_admin":false},"repo":{"id":33350829,"name":"robottelo","full_name":"oshtaier/robottelo","owner":{"login":"oshtaier","id":10895065,"avatar_url":"https://avatars.githubusercontent.com/u/10895065?v=3","gravatar_id":"","url":"https://api.github.com/users/oshtaier","html_url":"https://github.com/oshtaier","followers_url":"https://api.github.com/users/oshtaier/followers","following_url":"https://api.github.com/users/oshtaier/following{/other_user}","gists_url":"https://api.github.com/users/oshtaier/gists{/gist_id}","starred_url":"https://api.github.com/users/oshtaier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oshtaier/subscriptions","organizations_url":"https://api.github.com/users/oshtaier/orgs","repos_url":"https://api.github.com/users/oshtaier/repos","events_url":"https://api.github.com/users/oshtaier/events{/privacy}","received_events_url":"https://api.github.com/users/oshtaier/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/oshtaier/robottelo","description":"Robottelo is a test suite which exercises The Foreman.","fork":true,"url":"https://api.github.com/repos/oshtaier/robottelo","forks_url":"https://api.github.com/repos/oshtaier/robottelo/forks","keys_url":"https://api.github.com/repos/oshtaier/robottelo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/oshtaier/robottelo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/oshtaier/robottelo/teams","hooks_url":"https://api.github.com/repos/oshtaier/robottelo/hooks","issue_events_url":"https://api.github.com/repos/oshtaier/robottelo/issues/events{/number}","events_url":"https://api.github.com/repos/oshtaier/robottelo/events","assignees_url":"https://api.github.com/repos/oshtaier/robottelo/assignees{/user}","branches_url":"https://api.github.com/repos/oshtaier/robottelo/branches{/branch}","tags_url":"https://api.github.com/repos/oshtaier/robottelo/tags","blobs_url":"https://api.github.com/repos/oshtaier/robottelo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/oshtaier/robottelo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/oshtaier/robottelo/git/refs{/sha}","trees_url":"https://api.github.com/repos/oshtaier/robottelo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/oshtaier/robottelo/statuses/{sha}","languages_url":"https://api.github.com/repos/oshtaier/robottelo/languages","stargazers_url":"https://api.github.com/repos/oshtaier/robottelo/stargazers","contributors_url":"https://api.github.com/repos/oshtaier/robottelo/contributors","subscribers_url":"https://api.github.com/repos/oshtaier/robottelo/subscribers","subscription_url":"https://api.github.com/repos/oshtaier/robottelo/subscription","commits_url":"https://api.github.com/repos/oshtaier/robottelo/commits{/sha}","git_commits_url":"https://api.github.com/repos/oshtaier/robottelo/git/commits{/sha}","comments_url":"https://api.github.com/repos/oshtaier/robottelo/comments{/number}","issue_comment_url":"https://api.github.com/repos/oshtaier/robottelo/issues/comments{/number}","contents_url":"https://api.github.com/repos/oshtaier/robottelo/contents/{+path}","compare_url":"https://api.github.com/repos/oshtaier/robottelo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/oshtaier/robottelo/merges","archive_url":"https://api.github.com/repos/oshtaier/robottelo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/oshtaier/robottelo/downloads","issues_url":"https://api.github.com/repos/oshtaier/robottelo/issues{/number}","pulls_url":"https://api.github.com/repos/oshtaier/robottelo/pulls{/number}","milestones_url":"https://api.github.com/repos/oshtaier/robottelo/milestones{/number}","notifications_url":"https://api.github.com/repos/oshtaier/robottelo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/oshtaier/robottelo/labels{/name}","releases_url":"https://api.github.com/repos/oshtaier/robottelo/releases{/id}","deployments_url":"https://api.github.com/repos/oshtaier/robottelo/deployments","created_at":"2015-04-03T06:48:07Z","updated_at":"2015-04-06T12:49:17Z","pushed_at":"2016-06-16T13:45:40Z","git_url":"git://github.com/oshtaier/robottelo.git","ssh_url":"git@github.com:oshtaier/robottelo.git","clone_url":"https://github.com/oshtaier/robottelo.git","svn_url":"https://github.com/oshtaier/robottelo","homepage":"","size":12126,"stargazers_count":0,"watchers_count":0,"language":"Python","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":"SatelliteQE:master","ref":"master","sha":"f92ab346b5a3e3c8292ab398bc960300107e84b1","user":{"login":"SatelliteQE","id":8754276,"avatar_url":"https://avatars.githubusercontent.com/u/8754276?v=3","gravatar_id":"","url":"https://api.github.com/users/SatelliteQE","html_url":"https://github.com/SatelliteQE","followers_url":"https://api.github.com/users/SatelliteQE/followers","following_url":"https://api.github.com/users/SatelliteQE/following{/other_user}","gists_url":"https://api.github.com/users/SatelliteQE/gists{/gist_id}","starred_url":"https://api.github.com/users/SatelliteQE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SatelliteQE/subscriptions","organizations_url":"https://api.github.com/users/SatelliteQE/orgs","repos_url":"https://api.github.com/users/SatelliteQE/repos","events_url":"https://api.github.com/users/SatelliteQE/events{/privacy}","received_events_url":"https://api.github.com/users/SatelliteQE/received_events","type":"Organization","site_admin":false},"repo":{"id":4000279,"name":"robottelo","full_name":"SatelliteQE/robottelo","owner":{"login":"SatelliteQE","id":8754276,"avatar_url":"https://avatars.githubusercontent.com/u/8754276?v=3","gravatar_id":"","url":"https://api.github.com/users/SatelliteQE","html_url":"https://github.com/SatelliteQE","followers_url":"https://api.github.com/users/SatelliteQE/followers","following_url":"https://api.github.com/users/SatelliteQE/following{/other_user}","gists_url":"https://api.github.com/users/SatelliteQE/gists{/gist_id}","starred_url":"https://api.github.com/users/SatelliteQE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SatelliteQE/subscriptions","organizations_url":"https://api.github.com/users/SatelliteQE/orgs","repos_url":"https://api.github.com/users/SatelliteQE/repos","events_url":"https://api.github.com/users/SatelliteQE/events{/privacy}","received_events_url":"https://api.github.com/users/SatelliteQE/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SatelliteQE/robottelo","description":"Robottelo is a test suite which exercises The Foreman.","fork":false,"url":"https://api.github.com/repos/SatelliteQE/robottelo","forks_url":"https://api.github.com/repos/SatelliteQE/robottelo/forks","keys_url":"https://api.github.com/repos/SatelliteQE/robottelo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SatelliteQE/robottelo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SatelliteQE/robottelo/teams","hooks_url":"https://api.github.com/repos/SatelliteQE/robottelo/hooks","issue_events_url":"https://api.github.com/repos/SatelliteQE/robottelo/issues/events{/number}","events_url":"https://api.github.com/repos/SatelliteQE/robottelo/events","assignees_url":"https://api.github.com/repos/SatelliteQE/robottelo/assignees{/user}","branches_url":"https://api.github.com/repos/SatelliteQE/robottelo/branches{/branch}","tags_url":"https://api.github.com/repos/SatelliteQE/robottelo/tags","blobs_url":"https://api.github.com/repos/SatelliteQE/robottelo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SatelliteQE/robottelo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SatelliteQE/robottelo/git/refs{/sha}","trees_url":"https://api.github.com/repos/SatelliteQE/robottelo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SatelliteQE/robottelo/statuses/{sha}","languages_url":"https://api.github.com/repos/SatelliteQE/robottelo/languages","stargazers_url":"https://api.github.com/repos/SatelliteQE/robottelo/stargazers","contributors_url":"https://api.github.com/repos/SatelliteQE/robottelo/contributors","subscribers_url":"https://api.github.com/repos/SatelliteQE/robottelo/subscribers","subscription_url":"https://api.github.com/repos/SatelliteQE/robottelo/subscription","commits_url":"https://api.github.com/repos/SatelliteQE/robottelo/commits{/sha}","git_commits_url":"https://api.github.com/repos/SatelliteQE/robottelo/git/commits{/sha}","comments_url":"https://api.github.com/repos/SatelliteQE/robottelo/comments{/number}","issue_comment_url":"https://api.github.com/repos/SatelliteQE/robottelo/issues/comments{/number}","contents_url":"https://api.github.com/repos/SatelliteQE/robottelo/contents/{+path}","compare_url":"https://api.github.com/repos/SatelliteQE/robottelo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SatelliteQE/robottelo/merges","archive_url":"https://api.github.com/repos/SatelliteQE/robottelo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SatelliteQE/robottelo/downloads","issues_url":"https://api.github.com/repos/SatelliteQE/robottelo/issues{/number}","pulls_url":"https://api.github.com/repos/SatelliteQE/robottelo/pulls{/number}","milestones_url":"https://api.github.com/repos/SatelliteQE/robottelo/milestones{/number}","notifications_url":"https://api.github.com/repos/SatelliteQE/robottelo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SatelliteQE/robottelo/labels{/name}","releases_url":"https://api.github.com/repos/SatelliteQE/robottelo/releases{/id}","deployments_url":"https://api.github.com/repos/SatelliteQE/robottelo/deployments","created_at":"2012-04-12T01:36:39Z","updated_at":"2016-06-01T16:21:06Z","pushed_at":"2016-06-17T10:40:31Z","git_url":"git://github.com/SatelliteQE/robottelo.git","ssh_url":"git@github.com:SatelliteQE/robottelo.git","clone_url":"https://github.com/SatelliteQE/robottelo.git","svn_url":"https://github.com/SatelliteQE/robottelo","homepage":"","size":13222,"stargazers_count":24,"watchers_count":24,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":42,"mirror_url":null,"open_issues_count":140,"forks":42,"open_issues":140,"watchers":24,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/SatelliteQE/robottelo/pulls/3542"},"html":{"href":"https://github.com/SatelliteQE/robottelo/pull/3542"},"issue":{"href":"https://api.github.com/repos/SatelliteQE/robottelo/issues/3542"},"comments":{"href":"https://api.github.com/repos/SatelliteQE/robottelo/issues/3542/comments"},"review_comments":{"href":"https://api.github.com/repos/SatelliteQE/robottelo/pulls/3542/comments"},"review_comment":{"href":"https://api.github.com/repos/SatelliteQE/robottelo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/SatelliteQE/robottelo/pulls/3542/commits"},"statuses":{"href":"https://api.github.com/repos/SatelliteQE/robottelo/statuses/afc90176cb206b27583eb3c2bedc2fb8008747b0"}}}}
{"actor":{"display_login":"abalakh"}}