{"action":"created","issue":{"url":"https://api.github.com/repos/projectatomic/openshift2nulecule/issues/11","repository_url":"https://api.github.com/repos/projectatomic/openshift2nulecule","labels_url":"https://api.github.com/repos/projectatomic/openshift2nulecule/issues/11/labels{/name}","comments_url":"https://api.github.com/repos/projectatomic/openshift2nulecule/issues/11/comments","events_url":"https://api.github.com/repos/projectatomic/openshift2nulecule/issues/11/events","html_url":"https://github.com/projectatomic/openshift2nulecule/issues/11","id":137157969,"number":11,"title":"Use `which` and `subprocess` to find the location of `oc`","user":{"login":"surajssd","id":5815795,"avatar_url":"https://avatars.githubusercontent.com/u/5815795?v=3","gravatar_id":"","url":"https://api.github.com/users/surajssd","html_url":"https://github.com/surajssd","followers_url":"https://api.github.com/users/surajssd/followers","following_url":"https://api.github.com/users/surajssd/following{/other_user}","gists_url":"https://api.github.com/users/surajssd/gists{/gist_id}","starred_url":"https://api.github.com/users/surajssd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/surajssd/subscriptions","organizations_url":"https://api.github.com/users/surajssd/orgs","repos_url":"https://api.github.com/users/surajssd/repos","events_url":"https://api.github.com/users/surajssd/events{/privacy}","received_events_url":"https://api.github.com/users/surajssd/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/projectatomic/openshift2nulecule/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/projectatomic/openshift2nulecule/labels/priority:low","name":"priority:low","color":"CCCCCC"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-02-29T05:43:07Z","updated_at":"2016-03-16T13:23:11Z","closed_at":"2016-03-16T13:23:11Z","body":"In function [`_find_oc`](https://github.com/projectatomic/openshift2nulecule/blob/master/openshift2nulecule/openshift.py#L35) (which helps us find location of `oc` binary), what I suggest here is we can use python module `subprocess` and `linux` binary `which` to find the location of `oc` binary.\r\n\r\nSomething like this:\r\n`subprocess.check_output(['which', 'oc']).strip()`\r\n\r\nRather than manually looking in the paths it is installed."},"comment":{"url":"https://api.github.com/repos/projectatomic/openshift2nulecule/issues/comments/197327300","html_url":"https://github.com/projectatomic/openshift2nulecule/issues/11#issuecomment-197327300","issue_url":"https://api.github.com/repos/projectatomic/openshift2nulecule/issues/11","id":197327300,"user":{"login":"kadel","id":57206,"avatar_url":"https://avatars.githubusercontent.com/u/57206?v=3","gravatar_id":"","url":"https://api.github.com/users/kadel","html_url":"https://github.com/kadel","followers_url":"https://api.github.com/users/kadel/followers","following_url":"https://api.github.com/users/kadel/following{/other_user}","gists_url":"https://api.github.com/users/kadel/gists{/gist_id}","starred_url":"https://api.github.com/users/kadel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kadel/subscriptions","organizations_url":"https://api.github.com/users/kadel/orgs","repos_url":"https://api.github.com/users/kadel/repos","events_url":"https://api.github.com/users/kadel/events{/privacy}","received_events_url":"https://api.github.com/users/kadel/received_events","type":"User","site_admin":false},"created_at":"2016-03-16T13:23:11Z","updated_at":"2016-03-16T13:23:11Z","body":"I'm going to close this. We can revisit this if current solution starting to be problematic."}}