{"action":"created","comment":{"url":"https://api.github.com/repos/rhosqeauto/Infrared/pulls/comments/52570523","id":52570523,"diff_hunk":"@@ -0,0 +1,144 @@\n+import os\n+\n+import yaml\n+\n+from kcli import conf\n+from kcli import exceptions\n+from kcli import logger\n+\n+LOG = logger.LOG\n+\n+\n+class OptionNode(object):\n+    def __init__(self, path, parent=None):\n+        self.path = path\n+        self.option = self.path.split(\"/\")[-1]\n+        self.parent = parent\n+        self.parent_value = None\n+        if parent:\n+            self.option = \"-\".join([self.parent.option, self.option])\n+        self.values = self._get_values()\n+        self.children = {i: dict() for i in self._get_sub_options()}\n+\n+        if self.parent:\n+            self.parent_value = self.path.split(\"/\")[-2]\n+            self.parent.children[self.parent_value][self.option] = self\n+\n+    def _get_values(self):\n+        \"\"\"\n+        Returns a sorted list of values available for the current option\n+        \"\"\"\n+        values = [a_file.split(conf.YAML_EXT)[0]\n+                  for a_file in os.listdir(self.path)\n+                  if os.path.isfile(os.path.join(self.path, a_file)) and\n+                  a_file.endswith(conf.YAML_EXT)]\n+\n+        values.sort()\n+        return values\n+\n+    def _get_sub_options(self):\n+        \"\"\"\n+        Returns a sorted list of sup-options available for the current option\n+        \"\"\"\n+        options = [options_dir for options_dir in os.listdir(self.path)\n+                   if os.path.isdir(os.path.join(self.path, options_dir)) and\n+                   options_dir in self.values]\n+\n+        options.sort()\n+        return options\n+\n+\n+class OptionsTree(object):\n+    def __init__(self, settings_dir, option):","path":"tools/kcli/kcli/options.py","position":52,"original_position":52,"commit_id":"3864723765fb977b0a1d1421cdb0f6ee5c48f458","original_commit_id":"3864723765fb977b0a1d1421cdb0f6ee5c48f458","user":{"login":"yfried-redhat","id":5310525,"avatar_url":"https://avatars.githubusercontent.com/u/5310525?v=3","gravatar_id":"","url":"https://api.github.com/users/yfried-redhat","html_url":"https://github.com/yfried-redhat","followers_url":"https://api.github.com/users/yfried-redhat/followers","following_url":"https://api.github.com/users/yfried-redhat/following{/other_user}","gists_url":"https://api.github.com/users/yfried-redhat/gists{/gist_id}","starred_url":"https://api.github.com/users/yfried-redhat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yfried-redhat/subscriptions","organizations_url":"https://api.github.com/users/yfried-redhat/orgs","repos_url":"https://api.github.com/users/yfried-redhat/repos","events_url":"https://api.github.com/users/yfried-redhat/events{/privacy}","received_events_url":"https://api.github.com/users/yfried-redhat/received_events","type":"User","site_admin":false},"body":"missing class doc","created_at":"2016-02-11T07:44:35Z","updated_at":"2016-02-11T07:44:35Z","html_url":"https://github.com/rhosqeauto/Infrared/pull/24#discussion_r52570523","pull_request_url":"https://api.github.com/repos/rhosqeauto/Infrared/pulls/24","_links":{"self":{"href":"https://api.github.com/repos/rhosqeauto/Infrared/pulls/comments/52570523"},"html":{"href":"https://github.com/rhosqeauto/Infrared/pull/24#discussion_r52570523"},"pull_request":{"href":"https://api.github.com/repos/rhosqeauto/Infrared/pulls/24"}}},"pull_request":{"url":"https://api.github.com/repos/rhosqeauto/Infrared/pulls/24","id":58902389,"html_url":"https://github.com/rhosqeauto/Infrared/pull/24","diff_url":"https://github.com/rhosqeauto/Infrared/pull/24.diff","patch_url":"https://github.com/rhosqeauto/Infrared/pull/24.patch","issue_url":"https://api.github.com/repos/rhosqeauto/Infrared/issues/24","number":24,"state":"open","locked":false,"title":"Splits code to seperate modules & add documention","user":{"login":"aopincar","id":10795006,"avatar_url":"https://avatars.githubusercontent.com/u/10795006?v=3","gravatar_id":"","url":"https://api.github.com/users/aopincar","html_url":"https://github.com/aopincar","followers_url":"https://api.github.com/users/aopincar/followers","following_url":"https://api.github.com/users/aopincar/following{/other_user}","gists_url":"https://api.github.com/users/aopincar/gists{/gist_id}","starred_url":"https://api.github.com/users/aopincar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aopincar/subscriptions","organizations_url":"https://api.github.com/users/aopincar/orgs","repos_url":"https://api.github.com/users/aopincar/repos","events_url":"https://api.github.com/users/aopincar/events{/privacy}","received_events_url":"https://api.github.com/users/aopincar/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-02-10T15:04:13Z","updated_at":"2016-02-11T07:44:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9535968fd372d176a5d90fed01486b7282fbc4c4","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/rhosqeauto/Infrared/pulls/24/commits","review_comments_url":"https://api.github.com/repos/rhosqeauto/Infrared/pulls/24/comments","review_comment_url":"https://api.github.com/repos/rhosqeauto/Infrared/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rhosqeauto/Infrared/issues/24/comments","statuses_url":"https://api.github.com/repos/rhosqeauto/Infrared/statuses/3864723765fb977b0a1d1421cdb0f6ee5c48f458","head":{"label":"aopincar:kcli","ref":"kcli","sha":"3864723765fb977b0a1d1421cdb0f6ee5c48f458","user":{"login":"aopincar","id":10795006,"avatar_url":"https://avatars.githubusercontent.com/u/10795006?v=3","gravatar_id":"","url":"https://api.github.com/users/aopincar","html_url":"https://github.com/aopincar","followers_url":"https://api.github.com/users/aopincar/followers","following_url":"https://api.github.com/users/aopincar/following{/other_user}","gists_url":"https://api.github.com/users/aopincar/gists{/gist_id}","starred_url":"https://api.github.com/users/aopincar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aopincar/subscriptions","organizations_url":"https://api.github.com/users/aopincar/orgs","repos_url":"https://api.github.com/users/aopincar/repos","events_url":"https://api.github.com/users/aopincar/events{/privacy}","received_events_url":"https://api.github.com/users/aopincar/received_events","type":"User","site_admin":false},"repo":{"id":51249211,"name":"Infrared","full_name":"aopincar/Infrared","owner":{"login":"aopincar","id":10795006,"avatar_url":"https://avatars.githubusercontent.com/u/10795006?v=3","gravatar_id":"","url":"https://api.github.com/users/aopincar","html_url":"https://github.com/aopincar","followers_url":"https://api.github.com/users/aopincar/followers","following_url":"https://api.github.com/users/aopincar/following{/other_user}","gists_url":"https://api.github.com/users/aopincar/gists{/gist_id}","starred_url":"https://api.github.com/users/aopincar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aopincar/subscriptions","organizations_url":"https://api.github.com/users/aopincar/orgs","repos_url":"https://api.github.com/users/aopincar/repos","events_url":"https://api.github.com/users/aopincar/events{/privacy}","received_events_url":"https://api.github.com/users/aopincar/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/aopincar/Infrared","description":"Ansible framework for setting up OpenStack test environments","fork":true,"url":"https://api.github.com/repos/aopincar/Infrared","forks_url":"https://api.github.com/repos/aopincar/Infrared/forks","keys_url":"https://api.github.com/repos/aopincar/Infrared/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aopincar/Infrared/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aopincar/Infrared/teams","hooks_url":"https://api.github.com/repos/aopincar/Infrared/hooks","issue_events_url":"https://api.github.com/repos/aopincar/Infrared/issues/events{/number}","events_url":"https://api.github.com/repos/aopincar/Infrared/events","assignees_url":"https://api.github.com/repos/aopincar/Infrared/assignees{/user}","branches_url":"https://api.github.com/repos/aopincar/Infrared/branches{/branch}","tags_url":"https://api.github.com/repos/aopincar/Infrared/tags","blobs_url":"https://api.github.com/repos/aopincar/Infrared/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aopincar/Infrared/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aopincar/Infrared/git/refs{/sha}","trees_url":"https://api.github.com/repos/aopincar/Infrared/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aopincar/Infrared/statuses/{sha}","languages_url":"https://api.github.com/repos/aopincar/Infrared/languages","stargazers_url":"https://api.github.com/repos/aopincar/Infrared/stargazers","contributors_url":"https://api.github.com/repos/aopincar/Infrared/contributors","subscribers_url":"https://api.github.com/repos/aopincar/Infrared/subscribers","subscription_url":"https://api.github.com/repos/aopincar/Infrared/subscription","commits_url":"https://api.github.com/repos/aopincar/Infrared/commits{/sha}","git_commits_url":"https://api.github.com/repos/aopincar/Infrared/git/commits{/sha}","comments_url":"https://api.github.com/repos/aopincar/Infrared/comments{/number}","issue_comment_url":"https://api.github.com/repos/aopincar/Infrared/issues/comments{/number}","contents_url":"https://api.github.com/repos/aopincar/Infrared/contents/{+path}","compare_url":"https://api.github.com/repos/aopincar/Infrared/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aopincar/Infrared/merges","archive_url":"https://api.github.com/repos/aopincar/Infrared/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aopincar/Infrared/downloads","issues_url":"https://api.github.com/repos/aopincar/Infrared/issues{/number}","pulls_url":"https://api.github.com/repos/aopincar/Infrared/pulls{/number}","milestones_url":"https://api.github.com/repos/aopincar/Infrared/milestones{/number}","notifications_url":"https://api.github.com/repos/aopincar/Infrared/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aopincar/Infrared/labels{/name}","releases_url":"https://api.github.com/repos/aopincar/Infrared/releases{/id}","deployments_url":"https://api.github.com/repos/aopincar/Infrared/deployments","created_at":"2016-02-07T13:52:38Z","updated_at":"2016-02-07T13:52:39Z","pushed_at":"2016-02-10T15:03:41Z","git_url":"git://github.com/aopincar/Infrared.git","ssh_url":"git@github.com:aopincar/Infrared.git","clone_url":"https://github.com/aopincar/Infrared.git","svn_url":"https://github.com/aopincar/Infrared","homepage":null,"size":3187,"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":"dev/qe"}},"base":{"label":"rhosqeauto:dev/qe","ref":"dev/qe","sha":"127cbaf103b2b7497b836146a9ec8944f3c0e654","user":{"login":"rhosqeauto","id":17139118,"avatar_url":"https://avatars.githubusercontent.com/u/17139118?v=3","gravatar_id":"","url":"https://api.github.com/users/rhosqeauto","html_url":"https://github.com/rhosqeauto","followers_url":"https://api.github.com/users/rhosqeauto/followers","following_url":"https://api.github.com/users/rhosqeauto/following{/other_user}","gists_url":"https://api.github.com/users/rhosqeauto/gists{/gist_id}","starred_url":"https://api.github.com/users/rhosqeauto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rhosqeauto/subscriptions","organizations_url":"https://api.github.com/users/rhosqeauto/orgs","repos_url":"https://api.github.com/users/rhosqeauto/repos","events_url":"https://api.github.com/users/rhosqeauto/events{/privacy}","received_events_url":"https://api.github.com/users/rhosqeauto/received_events","type":"User","site_admin":false},"repo":{"id":51246792,"name":"Infrared","full_name":"rhosqeauto/Infrared","owner":{"login":"rhosqeauto","id":17139118,"avatar_url":"https://avatars.githubusercontent.com/u/17139118?v=3","gravatar_id":"","url":"https://api.github.com/users/rhosqeauto","html_url":"https://github.com/rhosqeauto","followers_url":"https://api.github.com/users/rhosqeauto/followers","following_url":"https://api.github.com/users/rhosqeauto/following{/other_user}","gists_url":"https://api.github.com/users/rhosqeauto/gists{/gist_id}","starred_url":"https://api.github.com/users/rhosqeauto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rhosqeauto/subscriptions","organizations_url":"https://api.github.com/users/rhosqeauto/orgs","repos_url":"https://api.github.com/users/rhosqeauto/repos","events_url":"https://api.github.com/users/rhosqeauto/events{/privacy}","received_events_url":"https://api.github.com/users/rhosqeauto/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rhosqeauto/Infrared","description":"Ansible framework for setting up OpenStack test environments","fork":true,"url":"https://api.github.com/repos/rhosqeauto/Infrared","forks_url":"https://api.github.com/repos/rhosqeauto/Infrared/forks","keys_url":"https://api.github.com/repos/rhosqeauto/Infrared/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rhosqeauto/Infrared/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rhosqeauto/Infrared/teams","hooks_url":"https://api.github.com/repos/rhosqeauto/Infrared/hooks","issue_events_url":"https://api.github.com/repos/rhosqeauto/Infrared/issues/events{/number}","events_url":"https://api.github.com/repos/rhosqeauto/Infrared/events","assignees_url":"https://api.github.com/repos/rhosqeauto/Infrared/assignees{/user}","branches_url":"https://api.github.com/repos/rhosqeauto/Infrared/branches{/branch}","tags_url":"https://api.github.com/repos/rhosqeauto/Infrared/tags","blobs_url":"https://api.github.com/repos/rhosqeauto/Infrared/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rhosqeauto/Infrared/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rhosqeauto/Infrared/git/refs{/sha}","trees_url":"https://api.github.com/repos/rhosqeauto/Infrared/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rhosqeauto/Infrared/statuses/{sha}","languages_url":"https://api.github.com/repos/rhosqeauto/Infrared/languages","stargazers_url":"https://api.github.com/repos/rhosqeauto/Infrared/stargazers","contributors_url":"https://api.github.com/repos/rhosqeauto/Infrared/contributors","subscribers_url":"https://api.github.com/repos/rhosqeauto/Infrared/subscribers","subscription_url":"https://api.github.com/repos/rhosqeauto/Infrared/subscription","commits_url":"https://api.github.com/repos/rhosqeauto/Infrared/commits{/sha}","git_commits_url":"https://api.github.com/repos/rhosqeauto/Infrared/git/commits{/sha}","comments_url":"https://api.github.com/repos/rhosqeauto/Infrared/comments{/number}","issue_comment_url":"https://api.github.com/repos/rhosqeauto/Infrared/issues/comments{/number}","contents_url":"https://api.github.com/repos/rhosqeauto/Infrared/contents/{+path}","compare_url":"https://api.github.com/repos/rhosqeauto/Infrared/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rhosqeauto/Infrared/merges","archive_url":"https://api.github.com/repos/rhosqeauto/Infrared/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rhosqeauto/Infrared/downloads","issues_url":"https://api.github.com/repos/rhosqeauto/Infrared/issues{/number}","pulls_url":"https://api.github.com/repos/rhosqeauto/Infrared/pulls{/number}","milestones_url":"https://api.github.com/repos/rhosqeauto/Infrared/milestones{/number}","notifications_url":"https://api.github.com/repos/rhosqeauto/Infrared/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rhosqeauto/Infrared/labels{/name}","releases_url":"https://api.github.com/repos/rhosqeauto/Infrared/releases{/id}","deployments_url":"https://api.github.com/repos/rhosqeauto/Infrared/deployments","created_at":"2016-02-07T12:28:47Z","updated_at":"2016-02-09T13:22:12Z","pushed_at":"2016-02-10T15:04:14Z","git_url":"git://github.com/rhosqeauto/Infrared.git","ssh_url":"git@github.com:rhosqeauto/Infrared.git","clone_url":"https://github.com/rhosqeauto/Infrared.git","svn_url":"https://github.com/rhosqeauto/Infrared","homepage":null,"size":3191,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":12,"forks":2,"open_issues":12,"watchers":0,"default_branch":"dev/qe"}},"_links":{"self":{"href":"https://api.github.com/repos/rhosqeauto/Infrared/pulls/24"},"html":{"href":"https://github.com/rhosqeauto/Infrared/pull/24"},"issue":{"href":"https://api.github.com/repos/rhosqeauto/Infrared/issues/24"},"comments":{"href":"https://api.github.com/repos/rhosqeauto/Infrared/issues/24/comments"},"review_comments":{"href":"https://api.github.com/repos/rhosqeauto/Infrared/pulls/24/comments"},"review_comment":{"href":"https://api.github.com/repos/rhosqeauto/Infrared/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rhosqeauto/Infrared/pulls/24/commits"},"statuses":{"href":"https://api.github.com/repos/rhosqeauto/Infrared/statuses/3864723765fb977b0a1d1421cdb0f6ee5c48f458"}}}}