{"action":"created","comment":{"url":"https://api.github.com/repos/openshift/openshift-tools/pulls/comments/84769568","pull_request_review_id":5526375,"id":84769568,"diff_hunk":"@@ -37,33 +145,57 @@ class MultiInventory(object):\n \n     def __init__(self, args=None):\n         # Allow args to be passed when called as a library\n-        if not args:\n-            self.args = {}\n-        else:\n+        self.args = {}\n+        if args != None:\n             self.args = args\n \n+        self.accounts = []\n+        self.cache_max_age = 1800\n         self.cache_path = DEFAULT_CACHE_PATH\n         self.config = None\n+        self.config_file = None\n+\n+        # Store each individual restuls by account name in this variable\n         self.all_inventory_results = {}\n+        # Store end results in this variable\n         self.result = {}\n-        self.file_path = os.path.join(os.path.dirname(os.path.realpath(__file__)))\n \n-        same_dir_config_file = os.path.join(self.file_path, CONFIG_FILE_NAME)\n-        etc_dir_config_file = os.path.join(os.path.sep, 'etc', 'ansible', CONFIG_FILE_NAME)\n+    def run(self):\n+        '''This method checks to see if the local cache is valid for the inventory.\n+\n+           if the cache is valid; return cache\n+           else the credentials are loaded from multi_inventory.yaml or from the env\n+           and we attempt to get the inventory from the provider specified.\n+        '''\n+\n+        # Finish loading configuration files\n+        self.load_config_settings()\n+\n+        if self.args.get('refresh_cache', None) or \\\n+           not MultiInventoryUtils.is_cache_valid(self.cache_path, self.cache_max_age):\n+            self.get_inventory()","path":"ansible/inventory/multi_inventory.py","position":null,"original_position":186,"commit_id":"23ffcb152741502a7bb91833adc597c5ac623a73","original_commit_id":"7e2ff8ea3e00bf3256827394742f9c122d09eb62","user":{"login":"kwoodson","id":1385770,"avatar_url":"https://avatars.githubusercontent.com/u/1385770?v=3","gravatar_id":"","url":"https://api.github.com/users/kwoodson","html_url":"https://github.com/kwoodson","followers_url":"https://api.github.com/users/kwoodson/followers","following_url":"https://api.github.com/users/kwoodson/following{/other_user}","gists_url":"https://api.github.com/users/kwoodson/gists{/gist_id}","starred_url":"https://api.github.com/users/kwoodson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kwoodson/subscriptions","organizations_url":"https://api.github.com/users/kwoodson/orgs","repos_url":"https://api.github.com/users/kwoodson/repos","events_url":"https://api.github.com/users/kwoodson/events{/privacy}","received_events_url":"https://api.github.com/users/kwoodson/received_events","type":"User","site_admin":false},"body":"Now have a return value for get_inventory.  We need to keep the self.result for the library calls from awsutil.","created_at":"2016-10-24T19:55:47Z","updated_at":"2016-10-24T19:55:47Z","html_url":"https://github.com/openshift/openshift-tools/pull/1427#discussion_r84769568","pull_request_url":"https://api.github.com/repos/openshift/openshift-tools/pulls/1427","_links":{"self":{"href":"https://api.github.com/repos/openshift/openshift-tools/pulls/comments/84769568"},"html":{"href":"https://github.com/openshift/openshift-tools/pull/1427#discussion_r84769568"},"pull_request":{"href":"https://api.github.com/repos/openshift/openshift-tools/pulls/1427"}}},"pull_request":{"url":"https://api.github.com/repos/openshift/openshift-tools/pulls/1427","id":90450880,"html_url":"https://github.com/openshift/openshift-tools/pull/1427","diff_url":"https://github.com/openshift/openshift-tools/pull/1427.diff","patch_url":"https://github.com/openshift/openshift-tools/pull/1427.patch","issue_url":"https://api.github.com/repos/openshift/openshift-tools/issues/1427","number":1427,"state":"open","locked":false,"title":"Separating accounts.","user":{"login":"kwoodson","id":1385770,"avatar_url":"https://avatars.githubusercontent.com/u/1385770?v=3","gravatar_id":"","url":"https://api.github.com/users/kwoodson","html_url":"https://github.com/kwoodson","followers_url":"https://api.github.com/users/kwoodson/followers","following_url":"https://api.github.com/users/kwoodson/following{/other_user}","gists_url":"https://api.github.com/users/kwoodson/gists{/gist_id}","starred_url":"https://api.github.com/users/kwoodson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kwoodson/subscriptions","organizations_url":"https://api.github.com/users/kwoodson/orgs","repos_url":"https://api.github.com/users/kwoodson/repos","events_url":"https://api.github.com/users/kwoodson/events{/privacy}","received_events_url":"https://api.github.com/users/kwoodson/received_events","type":"User","site_admin":false},"body":null,"created_at":"2016-10-21T21:59:15Z","updated_at":"2016-10-24T19:55:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a775f961e9af473c03263d4f2442392c857b3f3c","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/openshift/openshift-tools/pulls/1427/commits","review_comments_url":"https://api.github.com/repos/openshift/openshift-tools/pulls/1427/comments","review_comment_url":"https://api.github.com/repos/openshift/openshift-tools/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openshift/openshift-tools/issues/1427/comments","statuses_url":"https://api.github.com/repos/openshift/openshift-tools/statuses/23ffcb152741502a7bb91833adc597c5ac623a73","head":{"label":"kwoodson:multi_separation","ref":"multi_separation","sha":"23ffcb152741502a7bb91833adc597c5ac623a73","user":{"login":"kwoodson","id":1385770,"avatar_url":"https://avatars.githubusercontent.com/u/1385770?v=3","gravatar_id":"","url":"https://api.github.com/users/kwoodson","html_url":"https://github.com/kwoodson","followers_url":"https://api.github.com/users/kwoodson/followers","following_url":"https://api.github.com/users/kwoodson/following{/other_user}","gists_url":"https://api.github.com/users/kwoodson/gists{/gist_id}","starred_url":"https://api.github.com/users/kwoodson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kwoodson/subscriptions","organizations_url":"https://api.github.com/users/kwoodson/orgs","repos_url":"https://api.github.com/users/kwoodson/repos","events_url":"https://api.github.com/users/kwoodson/events{/privacy}","received_events_url":"https://api.github.com/users/kwoodson/received_events","type":"User","site_admin":false},"repo":{"id":38004846,"name":"openshift-tools","full_name":"kwoodson/openshift-tools","owner":{"login":"kwoodson","id":1385770,"avatar_url":"https://avatars.githubusercontent.com/u/1385770?v=3","gravatar_id":"","url":"https://api.github.com/users/kwoodson","html_url":"https://github.com/kwoodson","followers_url":"https://api.github.com/users/kwoodson/followers","following_url":"https://api.github.com/users/kwoodson/following{/other_user}","gists_url":"https://api.github.com/users/kwoodson/gists{/gist_id}","starred_url":"https://api.github.com/users/kwoodson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kwoodson/subscriptions","organizations_url":"https://api.github.com/users/kwoodson/orgs","repos_url":"https://api.github.com/users/kwoodson/repos","events_url":"https://api.github.com/users/kwoodson/events{/privacy}","received_events_url":"https://api.github.com/users/kwoodson/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kwoodson/openshift-tools","description":"A public repository of scripts used by OpenShift Operations for various purposes","fork":true,"url":"https://api.github.com/repos/kwoodson/openshift-tools","forks_url":"https://api.github.com/repos/kwoodson/openshift-tools/forks","keys_url":"https://api.github.com/repos/kwoodson/openshift-tools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kwoodson/openshift-tools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kwoodson/openshift-tools/teams","hooks_url":"https://api.github.com/repos/kwoodson/openshift-tools/hooks","issue_events_url":"https://api.github.com/repos/kwoodson/openshift-tools/issues/events{/number}","events_url":"https://api.github.com/repos/kwoodson/openshift-tools/events","assignees_url":"https://api.github.com/repos/kwoodson/openshift-tools/assignees{/user}","branches_url":"https://api.github.com/repos/kwoodson/openshift-tools/branches{/branch}","tags_url":"https://api.github.com/repos/kwoodson/openshift-tools/tags","blobs_url":"https://api.github.com/repos/kwoodson/openshift-tools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kwoodson/openshift-tools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kwoodson/openshift-tools/git/refs{/sha}","trees_url":"https://api.github.com/repos/kwoodson/openshift-tools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kwoodson/openshift-tools/statuses/{sha}","languages_url":"https://api.github.com/repos/kwoodson/openshift-tools/languages","stargazers_url":"https://api.github.com/repos/kwoodson/openshift-tools/stargazers","contributors_url":"https://api.github.com/repos/kwoodson/openshift-tools/contributors","subscribers_url":"https://api.github.com/repos/kwoodson/openshift-tools/subscribers","subscription_url":"https://api.github.com/repos/kwoodson/openshift-tools/subscription","commits_url":"https://api.github.com/repos/kwoodson/openshift-tools/commits{/sha}","git_commits_url":"https://api.github.com/repos/kwoodson/openshift-tools/git/commits{/sha}","comments_url":"https://api.github.com/repos/kwoodson/openshift-tools/comments{/number}","issue_comment_url":"https://api.github.com/repos/kwoodson/openshift-tools/issues/comments{/number}","contents_url":"https://api.github.com/repos/kwoodson/openshift-tools/contents/{+path}","compare_url":"https://api.github.com/repos/kwoodson/openshift-tools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kwoodson/openshift-tools/merges","archive_url":"https://api.github.com/repos/kwoodson/openshift-tools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kwoodson/openshift-tools/downloads","issues_url":"https://api.github.com/repos/kwoodson/openshift-tools/issues{/number}","pulls_url":"https://api.github.com/repos/kwoodson/openshift-tools/pulls{/number}","milestones_url":"https://api.github.com/repos/kwoodson/openshift-tools/milestones{/number}","notifications_url":"https://api.github.com/repos/kwoodson/openshift-tools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kwoodson/openshift-tools/labels{/name}","releases_url":"https://api.github.com/repos/kwoodson/openshift-tools/releases{/id}","deployments_url":"https://api.github.com/repos/kwoodson/openshift-tools/deployments","created_at":"2015-06-24T18:56:29Z","updated_at":"2016-01-18T19:33:09Z","pushed_at":"2016-10-24T19:52:13Z","git_url":"git://github.com/kwoodson/openshift-tools.git","ssh_url":"git@github.com:kwoodson/openshift-tools.git","clone_url":"https://github.com/kwoodson/openshift-tools.git","svn_url":"https://github.com/kwoodson/openshift-tools","homepage":null,"size":5414,"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":"openshift:stg","ref":"stg","sha":"68c194c1c738ea973340db6d3b814cc8dacb257c","user":{"login":"openshift","id":792337,"avatar_url":"https://avatars.githubusercontent.com/u/792337?v=3","gravatar_id":"","url":"https://api.github.com/users/openshift","html_url":"https://github.com/openshift","followers_url":"https://api.github.com/users/openshift/followers","following_url":"https://api.github.com/users/openshift/following{/other_user}","gists_url":"https://api.github.com/users/openshift/gists{/gist_id}","starred_url":"https://api.github.com/users/openshift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openshift/subscriptions","organizations_url":"https://api.github.com/users/openshift/orgs","repos_url":"https://api.github.com/users/openshift/repos","events_url":"https://api.github.com/users/openshift/events{/privacy}","received_events_url":"https://api.github.com/users/openshift/received_events","type":"Organization","site_admin":false},"repo":{"id":36827699,"name":"openshift-tools","full_name":"openshift/openshift-tools","owner":{"login":"openshift","id":792337,"avatar_url":"https://avatars.githubusercontent.com/u/792337?v=3","gravatar_id":"","url":"https://api.github.com/users/openshift","html_url":"https://github.com/openshift","followers_url":"https://api.github.com/users/openshift/followers","following_url":"https://api.github.com/users/openshift/following{/other_user}","gists_url":"https://api.github.com/users/openshift/gists{/gist_id}","starred_url":"https://api.github.com/users/openshift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openshift/subscriptions","organizations_url":"https://api.github.com/users/openshift/orgs","repos_url":"https://api.github.com/users/openshift/repos","events_url":"https://api.github.com/users/openshift/events{/privacy}","received_events_url":"https://api.github.com/users/openshift/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openshift/openshift-tools","description":"A public repository of scripts used by OpenShift Operations for various purposes","fork":false,"url":"https://api.github.com/repos/openshift/openshift-tools","forks_url":"https://api.github.com/repos/openshift/openshift-tools/forks","keys_url":"https://api.github.com/repos/openshift/openshift-tools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openshift/openshift-tools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openshift/openshift-tools/teams","hooks_url":"https://api.github.com/repos/openshift/openshift-tools/hooks","issue_events_url":"https://api.github.com/repos/openshift/openshift-tools/issues/events{/number}","events_url":"https://api.github.com/repos/openshift/openshift-tools/events","assignees_url":"https://api.github.com/repos/openshift/openshift-tools/assignees{/user}","branches_url":"https://api.github.com/repos/openshift/openshift-tools/branches{/branch}","tags_url":"https://api.github.com/repos/openshift/openshift-tools/tags","blobs_url":"https://api.github.com/repos/openshift/openshift-tools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openshift/openshift-tools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openshift/openshift-tools/git/refs{/sha}","trees_url":"https://api.github.com/repos/openshift/openshift-tools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openshift/openshift-tools/statuses/{sha}","languages_url":"https://api.github.com/repos/openshift/openshift-tools/languages","stargazers_url":"https://api.github.com/repos/openshift/openshift-tools/stargazers","contributors_url":"https://api.github.com/repos/openshift/openshift-tools/contributors","subscribers_url":"https://api.github.com/repos/openshift/openshift-tools/subscribers","subscription_url":"https://api.github.com/repos/openshift/openshift-tools/subscription","commits_url":"https://api.github.com/repos/openshift/openshift-tools/commits{/sha}","git_commits_url":"https://api.github.com/repos/openshift/openshift-tools/git/commits{/sha}","comments_url":"https://api.github.com/repos/openshift/openshift-tools/comments{/number}","issue_comment_url":"https://api.github.com/repos/openshift/openshift-tools/issues/comments{/number}","contents_url":"https://api.github.com/repos/openshift/openshift-tools/contents/{+path}","compare_url":"https://api.github.com/repos/openshift/openshift-tools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openshift/openshift-tools/merges","archive_url":"https://api.github.com/repos/openshift/openshift-tools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openshift/openshift-tools/downloads","issues_url":"https://api.github.com/repos/openshift/openshift-tools/issues{/number}","pulls_url":"https://api.github.com/repos/openshift/openshift-tools/pulls{/number}","milestones_url":"https://api.github.com/repos/openshift/openshift-tools/milestones{/number}","notifications_url":"https://api.github.com/repos/openshift/openshift-tools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openshift/openshift-tools/labels{/name}","releases_url":"https://api.github.com/repos/openshift/openshift-tools/releases{/id}","deployments_url":"https://api.github.com/repos/openshift/openshift-tools/deployments","created_at":"2015-06-03T20:09:22Z","updated_at":"2016-10-24T00:29:04Z","pushed_at":"2016-10-24T19:52:14Z","git_url":"git://github.com/openshift/openshift-tools.git","ssh_url":"git@github.com:openshift/openshift-tools.git","clone_url":"https://github.com/openshift/openshift-tools.git","svn_url":"https://github.com/openshift/openshift-tools","homepage":null,"size":5795,"stargazers_count":21,"watchers_count":21,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":48,"mirror_url":null,"open_issues_count":26,"forks":48,"open_issues":26,"watchers":21,"default_branch":"stg"}},"_links":{"self":{"href":"https://api.github.com/repos/openshift/openshift-tools/pulls/1427"},"html":{"href":"https://github.com/openshift/openshift-tools/pull/1427"},"issue":{"href":"https://api.github.com/repos/openshift/openshift-tools/issues/1427"},"comments":{"href":"https://api.github.com/repos/openshift/openshift-tools/issues/1427/comments"},"review_comments":{"href":"https://api.github.com/repos/openshift/openshift-tools/pulls/1427/comments"},"review_comment":{"href":"https://api.github.com/repos/openshift/openshift-tools/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openshift/openshift-tools/pulls/1427/commits"},"statuses":{"href":"https://api.github.com/repos/openshift/openshift-tools/statuses/23ffcb152741502a7bb91833adc597c5ac623a73"}}}}
{"actor":{"display_login":"kwoodson"}}