{"action":"created","issue":{"url":"https://api.github.com/repos/SatelliteQE/robottelo/issues/2638","labels_url":"https://api.github.com/repos/SatelliteQE/robottelo/issues/2638/labels{/name}","comments_url":"https://api.github.com/repos/SatelliteQE/robottelo/issues/2638/comments","events_url":"https://api.github.com/repos/SatelliteQE/robottelo/issues/2638/events","html_url":"https://github.com/SatelliteQE/robottelo/issues/2638","id":98421738,"number":2638,"title":"Create helper funcs for `enable_rhrepo` and `disable_rhrepo`","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},"labels":[{"url":"https://api.github.com/repos/SatelliteQE/robottelo/labels/Infrastructure","name":"Infrastructure","color":"5319e7"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-07-31T16:11:58Z","updated_at":"2015-11-30T09:53:29Z","closed_at":null,"body":"Per #2632 discussion.\r\nTo enable/disable RH repository, we usually do the same repeatable steps, like\r\n* Find product by name & org.id\r\n* Find repository set by name & product id\r\n* Enable/disable repo by reposet id & product id\r\n\r\nAll above should be covered by helper function. We already have `enable_rhrepo_and_fetchid()` in `robottelo/api/utils.py`, but\r\n* It only enables repo, we still need `disable` func\r\n* I'm not sure whether `robottelo/api/utils.py` is the best place for it, i'd think about `robottelo/common/helpers.py`\r\n* It's not factory-like: works with reposet & product names. But what if we already know reposet & product ids? We don't need to search for entities in that case, and org.id parameter is redundant.\r\n* It returns enabled repo id. That's a good thing, but it requires passing repo_name as required parameter, and we don't always need that id and not always know the repo name, so this functionality should be optional.\r\n\r\nSummarizing, `enable_rhrepo_and_fetchid()` is not completely covering all the needs, so better helper funcs `enable_rhrepo` and `disable_rhrepo` should be created instead."},"comment":{"url":"https://api.github.com/repos/SatelliteQE/robottelo/issues/comments/160580055","html_url":"https://github.com/SatelliteQE/robottelo/issues/2638#issuecomment-160580055","issue_url":"https://api.github.com/repos/SatelliteQE/robottelo/issues/2638","id":160580055,"user":{"login":"kbidarkar","id":373096,"avatar_url":"https://avatars.githubusercontent.com/u/373096?v=3","gravatar_id":"","url":"https://api.github.com/users/kbidarkar","html_url":"https://github.com/kbidarkar","followers_url":"https://api.github.com/users/kbidarkar/followers","following_url":"https://api.github.com/users/kbidarkar/following{/other_user}","gists_url":"https://api.github.com/users/kbidarkar/gists{/gist_id}","starred_url":"https://api.github.com/users/kbidarkar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kbidarkar/subscriptions","organizations_url":"https://api.github.com/users/kbidarkar/orgs","repos_url":"https://api.github.com/users/kbidarkar/repos","events_url":"https://api.github.com/users/kbidarkar/events{/privacy}","received_events_url":"https://api.github.com/users/kbidarkar/received_events","type":"User","site_admin":false},"created_at":"2015-11-30T09:53:29Z","updated_at":"2015-11-30T09:53:29Z","body":":+1:  for improving the code,  I was thinking only from functionality aspect.\r\nIt would really be good to see the function/code evolve/improve. Let's keep raising such issues to help improve/make code intuitive."}}