{"action":"created","comment":{"url":"https://api.github.com/repos/projectatomic/atomic-reactor/pulls/comments/102020689","pull_request_review_id":22763332,"id":102020689,"diff_hunk":"@@ -0,0 +1,155 @@\n+\"\"\"\n+Copyright (c) 2017 Red Hat, Inc\n+All rights reserved.\n+\n+This software may be modified and distributed under the terms\n+of the BSD license. See the LICENSE file for details.\n+\"\"\"\n+from __future__ import unicode_literals\n+\n+from atomic_reactor.plugin import PreBuildPlugin\n+\n+import codecs\n+import json\n+import jsonschema\n+import logging\n+from pkg_resources import resource_stream\n+import yaml\n+\n+\n+# Key used to store the config object in the plugin workspace\n+WORKSPACE_CONF_KEY = 'reactor_config'\n+\n+# Default configuration if none specified\n+DEFAULT_CONFIG = {}\n+\n+\n+def get_config(workflow):\n+    \"\"\"\n+    Obtain configuration object\n+    Does not fail\n+\n+    :return: ReactorConfig instance\n+    \"\"\"\n+    try:\n+        workspace = workflow.plugin_workspace[ReactorConfigPlugin.key]\n+        return workspace[WORKSPACE_CONF_KEY]\n+    except KeyError:\n+        # The plugin did not run or was not successful: use defaults\n+        conf = ReactorConfig(DEFAULT_CONFIG)\n+        workspace = workflow.plugin_workspace.get(ReactorConfigPlugin.key, {})\n+        workspace[WORKSPACE_CONF_KEY] = conf\n+        workflow.plugin_workspace[ReactorConfigPlugin.key] = workspace\n+        return conf\n+\n+\n+class ClusterConfig(object):\n+    \"\"\"\n+    Configuration relating to a particular cluster\n+    \"\"\"\n+\n+    def __init__(self, name, max_concurrent_builds=None, enabled=True):\n+        self.name = str(name)\n+        self.max_concurrent_builds = None\n+        self.enabled = enabled\n+\n+        if max_concurrent_builds is not None:\n+            self.max_concurrent_builds = int(max_concurrent_builds)\n+\n+\n+class ReactorConfig(object):\n+    \"\"\"\n+    Class to parse the atomic-reactor configuration file\n+    \"\"\"\n+\n+    CLUSTERS_KEY = 'clusters'\n+\n+    def __init__(self, config, log=None):\n+        self.conf = config or {}\n+        self.log = log or logging.getLogger(__name__)","path":"atomic_reactor/plugins/pre_reactor_config.py","position":null,"original_position":69,"commit_id":"f9eb632b3a89dd2a9cc4345299eb4541a775744d","original_commit_id":"fe061c3fc99b66778e1105eeb9c27b58b522afb8","user":{"login":"twaugh","id":6985468,"avatar_url":"https://avatars.githubusercontent.com/u/6985468?v=3","gravatar_id":"","url":"https://api.github.com/users/twaugh","html_url":"https://github.com/twaugh","followers_url":"https://api.github.com/users/twaugh/followers","following_url":"https://api.github.com/users/twaugh/following{/other_user}","gists_url":"https://api.github.com/users/twaugh/gists{/gist_id}","starred_url":"https://api.github.com/users/twaugh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twaugh/subscriptions","organizations_url":"https://api.github.com/users/twaugh/orgs","repos_url":"https://api.github.com/users/twaugh/repos","events_url":"https://api.github.com/users/twaugh/events{/privacy}","received_events_url":"https://api.github.com/users/twaugh/received_events","type":"User","site_admin":false},"body":"It isn't. Removed.","created_at":"2017-02-20T13:47:17Z","updated_at":"2017-02-20T13:47:17Z","html_url":"https://github.com/projectatomic/atomic-reactor/pull/651#discussion_r102020689","pull_request_url":"https://api.github.com/repos/projectatomic/atomic-reactor/pulls/651","_links":{"self":{"href":"https://api.github.com/repos/projectatomic/atomic-reactor/pulls/comments/102020689"},"html":{"href":"https://github.com/projectatomic/atomic-reactor/pull/651#discussion_r102020689"},"pull_request":{"href":"https://api.github.com/repos/projectatomic/atomic-reactor/pulls/651"}}},"pull_request":{"url":"https://api.github.com/repos/projectatomic/atomic-reactor/pulls/651","id":106777268,"html_url":"https://github.com/projectatomic/atomic-reactor/pull/651","diff_url":"https://github.com/projectatomic/atomic-reactor/pull/651.diff","patch_url":"https://github.com/projectatomic/atomic-reactor/pull/651.patch","issue_url":"https://api.github.com/repos/projectatomic/atomic-reactor/issues/651","number":651,"state":"open","locked":false,"title":"Add new reactor_config pre-build plugin","user":{"login":"twaugh","id":6985468,"avatar_url":"https://avatars.githubusercontent.com/u/6985468?v=3","gravatar_id":"","url":"https://api.github.com/users/twaugh","html_url":"https://github.com/twaugh","followers_url":"https://api.github.com/users/twaugh/followers","following_url":"https://api.github.com/users/twaugh/following{/other_user}","gists_url":"https://api.github.com/users/twaugh/gists{/gist_id}","starred_url":"https://api.github.com/users/twaugh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twaugh/subscriptions","organizations_url":"https://api.github.com/users/twaugh/orgs","repos_url":"https://api.github.com/users/twaugh/repos","events_url":"https://api.github.com/users/twaugh/events{/privacy}","received_events_url":"https://api.github.com/users/twaugh/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-02-17T17:30:04Z","updated_at":"2017-02-20T13:47:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e4a6766a0906b0b784b1cffe4b210a14c987e8fe","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/projectatomic/atomic-reactor/pulls/651/commits","review_comments_url":"https://api.github.com/repos/projectatomic/atomic-reactor/pulls/651/comments","review_comment_url":"https://api.github.com/repos/projectatomic/atomic-reactor/pulls/comments{/number}","comments_url":"https://api.github.com/repos/projectatomic/atomic-reactor/issues/651/comments","statuses_url":"https://api.github.com/repos/projectatomic/atomic-reactor/statuses/f9eb632b3a89dd2a9cc4345299eb4541a775744d","head":{"label":"projectatomic:reactor_config","ref":"reactor_config","sha":"f9eb632b3a89dd2a9cc4345299eb4541a775744d","user":{"login":"projectatomic","id":6852258,"avatar_url":"https://avatars.githubusercontent.com/u/6852258?v=3","gravatar_id":"","url":"https://api.github.com/users/projectatomic","html_url":"https://github.com/projectatomic","followers_url":"https://api.github.com/users/projectatomic/followers","following_url":"https://api.github.com/users/projectatomic/following{/other_user}","gists_url":"https://api.github.com/users/projectatomic/gists{/gist_id}","starred_url":"https://api.github.com/users/projectatomic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/projectatomic/subscriptions","organizations_url":"https://api.github.com/users/projectatomic/orgs","repos_url":"https://api.github.com/users/projectatomic/repos","events_url":"https://api.github.com/users/projectatomic/events{/privacy}","received_events_url":"https://api.github.com/users/projectatomic/received_events","type":"Organization","site_admin":false},"repo":{"id":25527782,"name":"atomic-reactor","full_name":"projectatomic/atomic-reactor","owner":{"login":"projectatomic","id":6852258,"avatar_url":"https://avatars.githubusercontent.com/u/6852258?v=3","gravatar_id":"","url":"https://api.github.com/users/projectatomic","html_url":"https://github.com/projectatomic","followers_url":"https://api.github.com/users/projectatomic/followers","following_url":"https://api.github.com/users/projectatomic/following{/other_user}","gists_url":"https://api.github.com/users/projectatomic/gists{/gist_id}","starred_url":"https://api.github.com/users/projectatomic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/projectatomic/subscriptions","organizations_url":"https://api.github.com/users/projectatomic/orgs","repos_url":"https://api.github.com/users/projectatomic/repos","events_url":"https://api.github.com/users/projectatomic/events{/privacy}","received_events_url":"https://api.github.com/users/projectatomic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/projectatomic/atomic-reactor","description":"Simple python library for building docker images.","fork":false,"url":"https://api.github.com/repos/projectatomic/atomic-reactor","forks_url":"https://api.github.com/repos/projectatomic/atomic-reactor/forks","keys_url":"https://api.github.com/repos/projectatomic/atomic-reactor/keys{/key_id}","collaborators_url":"https://api.github.com/repos/projectatomic/atomic-reactor/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/projectatomic/atomic-reactor/teams","hooks_url":"https://api.github.com/repos/projectatomic/atomic-reactor/hooks","issue_events_url":"https://api.github.com/repos/projectatomic/atomic-reactor/issues/events{/number}","events_url":"https://api.github.com/repos/projectatomic/atomic-reactor/events","assignees_url":"https://api.github.com/repos/projectatomic/atomic-reactor/assignees{/user}","branches_url":"https://api.github.com/repos/projectatomic/atomic-reactor/branches{/branch}","tags_url":"https://api.github.com/repos/projectatomic/atomic-reactor/tags","blobs_url":"https://api.github.com/repos/projectatomic/atomic-reactor/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/projectatomic/atomic-reactor/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/projectatomic/atomic-reactor/git/refs{/sha}","trees_url":"https://api.github.com/repos/projectatomic/atomic-reactor/git/trees{/sha}","statuses_url":"https://api.github.com/repos/projectatomic/atomic-reactor/statuses/{sha}","languages_url":"https://api.github.com/repos/projectatomic/atomic-reactor/languages","stargazers_url":"https://api.github.com/repos/projectatomic/atomic-reactor/stargazers","contributors_url":"https://api.github.com/repos/projectatomic/atomic-reactor/contributors","subscribers_url":"https://api.github.com/repos/projectatomic/atomic-reactor/subscribers","subscription_url":"https://api.github.com/repos/projectatomic/atomic-reactor/subscription","commits_url":"https://api.github.com/repos/projectatomic/atomic-reactor/commits{/sha}","git_commits_url":"https://api.github.com/repos/projectatomic/atomic-reactor/git/commits{/sha}","comments_url":"https://api.github.com/repos/projectatomic/atomic-reactor/comments{/number}","issue_comment_url":"https://api.github.com/repos/projectatomic/atomic-reactor/issues/comments{/number}","contents_url":"https://api.github.com/repos/projectatomic/atomic-reactor/contents/{+path}","compare_url":"https://api.github.com/repos/projectatomic/atomic-reactor/compare/{base}...{head}","merges_url":"https://api.github.com/repos/projectatomic/atomic-reactor/merges","archive_url":"https://api.github.com/repos/projectatomic/atomic-reactor/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/projectatomic/atomic-reactor/downloads","issues_url":"https://api.github.com/repos/projectatomic/atomic-reactor/issues{/number}","pulls_url":"https://api.github.com/repos/projectatomic/atomic-reactor/pulls{/number}","milestones_url":"https://api.github.com/repos/projectatomic/atomic-reactor/milestones{/number}","notifications_url":"https://api.github.com/repos/projectatomic/atomic-reactor/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/projectatomic/atomic-reactor/labels{/name}","releases_url":"https://api.github.com/repos/projectatomic/atomic-reactor/releases{/id}","deployments_url":"https://api.github.com/repos/projectatomic/atomic-reactor/deployments","created_at":"2014-10-21T14:45:11Z","updated_at":"2017-02-19T06:46:12Z","pushed_at":"2017-02-20T13:46:08Z","git_url":"git://github.com/projectatomic/atomic-reactor.git","ssh_url":"git@github.com:projectatomic/atomic-reactor.git","clone_url":"https://github.com/projectatomic/atomic-reactor.git","svn_url":"https://github.com/projectatomic/atomic-reactor","homepage":"","size":1731,"stargazers_count":74,"watchers_count":74,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":31,"mirror_url":null,"open_issues_count":60,"forks":31,"open_issues":60,"watchers":74,"default_branch":"master"}},"base":{"label":"projectatomic:master","ref":"master","sha":"4f2c4240395109f8e08ebbab1753c1ac809f122a","user":{"login":"projectatomic","id":6852258,"avatar_url":"https://avatars.githubusercontent.com/u/6852258?v=3","gravatar_id":"","url":"https://api.github.com/users/projectatomic","html_url":"https://github.com/projectatomic","followers_url":"https://api.github.com/users/projectatomic/followers","following_url":"https://api.github.com/users/projectatomic/following{/other_user}","gists_url":"https://api.github.com/users/projectatomic/gists{/gist_id}","starred_url":"https://api.github.com/users/projectatomic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/projectatomic/subscriptions","organizations_url":"https://api.github.com/users/projectatomic/orgs","repos_url":"https://api.github.com/users/projectatomic/repos","events_url":"https://api.github.com/users/projectatomic/events{/privacy}","received_events_url":"https://api.github.com/users/projectatomic/received_events","type":"Organization","site_admin":false},"repo":{"id":25527782,"name":"atomic-reactor","full_name":"projectatomic/atomic-reactor","owner":{"login":"projectatomic","id":6852258,"avatar_url":"https://avatars.githubusercontent.com/u/6852258?v=3","gravatar_id":"","url":"https://api.github.com/users/projectatomic","html_url":"https://github.com/projectatomic","followers_url":"https://api.github.com/users/projectatomic/followers","following_url":"https://api.github.com/users/projectatomic/following{/other_user}","gists_url":"https://api.github.com/users/projectatomic/gists{/gist_id}","starred_url":"https://api.github.com/users/projectatomic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/projectatomic/subscriptions","organizations_url":"https://api.github.com/users/projectatomic/orgs","repos_url":"https://api.github.com/users/projectatomic/repos","events_url":"https://api.github.com/users/projectatomic/events{/privacy}","received_events_url":"https://api.github.com/users/projectatomic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/projectatomic/atomic-reactor","description":"Simple python library for building docker images.","fork":false,"url":"https://api.github.com/repos/projectatomic/atomic-reactor","forks_url":"https://api.github.com/repos/projectatomic/atomic-reactor/forks","keys_url":"https://api.github.com/repos/projectatomic/atomic-reactor/keys{/key_id}","collaborators_url":"https://api.github.com/repos/projectatomic/atomic-reactor/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/projectatomic/atomic-reactor/teams","hooks_url":"https://api.github.com/repos/projectatomic/atomic-reactor/hooks","issue_events_url":"https://api.github.com/repos/projectatomic/atomic-reactor/issues/events{/number}","events_url":"https://api.github.com/repos/projectatomic/atomic-reactor/events","assignees_url":"https://api.github.com/repos/projectatomic/atomic-reactor/assignees{/user}","branches_url":"https://api.github.com/repos/projectatomic/atomic-reactor/branches{/branch}","tags_url":"https://api.github.com/repos/projectatomic/atomic-reactor/tags","blobs_url":"https://api.github.com/repos/projectatomic/atomic-reactor/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/projectatomic/atomic-reactor/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/projectatomic/atomic-reactor/git/refs{/sha}","trees_url":"https://api.github.com/repos/projectatomic/atomic-reactor/git/trees{/sha}","statuses_url":"https://api.github.com/repos/projectatomic/atomic-reactor/statuses/{sha}","languages_url":"https://api.github.com/repos/projectatomic/atomic-reactor/languages","stargazers_url":"https://api.github.com/repos/projectatomic/atomic-reactor/stargazers","contributors_url":"https://api.github.com/repos/projectatomic/atomic-reactor/contributors","subscribers_url":"https://api.github.com/repos/projectatomic/atomic-reactor/subscribers","subscription_url":"https://api.github.com/repos/projectatomic/atomic-reactor/subscription","commits_url":"https://api.github.com/repos/projectatomic/atomic-reactor/commits{/sha}","git_commits_url":"https://api.github.com/repos/projectatomic/atomic-reactor/git/commits{/sha}","comments_url":"https://api.github.com/repos/projectatomic/atomic-reactor/comments{/number}","issue_comment_url":"https://api.github.com/repos/projectatomic/atomic-reactor/issues/comments{/number}","contents_url":"https://api.github.com/repos/projectatomic/atomic-reactor/contents/{+path}","compare_url":"https://api.github.com/repos/projectatomic/atomic-reactor/compare/{base}...{head}","merges_url":"https://api.github.com/repos/projectatomic/atomic-reactor/merges","archive_url":"https://api.github.com/repos/projectatomic/atomic-reactor/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/projectatomic/atomic-reactor/downloads","issues_url":"https://api.github.com/repos/projectatomic/atomic-reactor/issues{/number}","pulls_url":"https://api.github.com/repos/projectatomic/atomic-reactor/pulls{/number}","milestones_url":"https://api.github.com/repos/projectatomic/atomic-reactor/milestones{/number}","notifications_url":"https://api.github.com/repos/projectatomic/atomic-reactor/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/projectatomic/atomic-reactor/labels{/name}","releases_url":"https://api.github.com/repos/projectatomic/atomic-reactor/releases{/id}","deployments_url":"https://api.github.com/repos/projectatomic/atomic-reactor/deployments","created_at":"2014-10-21T14:45:11Z","updated_at":"2017-02-19T06:46:12Z","pushed_at":"2017-02-20T13:46:08Z","git_url":"git://github.com/projectatomic/atomic-reactor.git","ssh_url":"git@github.com:projectatomic/atomic-reactor.git","clone_url":"https://github.com/projectatomic/atomic-reactor.git","svn_url":"https://github.com/projectatomic/atomic-reactor","homepage":"","size":1731,"stargazers_count":74,"watchers_count":74,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":31,"mirror_url":null,"open_issues_count":60,"forks":31,"open_issues":60,"watchers":74,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/projectatomic/atomic-reactor/pulls/651"},"html":{"href":"https://github.com/projectatomic/atomic-reactor/pull/651"},"issue":{"href":"https://api.github.com/repos/projectatomic/atomic-reactor/issues/651"},"comments":{"href":"https://api.github.com/repos/projectatomic/atomic-reactor/issues/651/comments"},"review_comments":{"href":"https://api.github.com/repos/projectatomic/atomic-reactor/pulls/651/comments"},"review_comment":{"href":"https://api.github.com/repos/projectatomic/atomic-reactor/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/projectatomic/atomic-reactor/pulls/651/commits"},"statuses":{"href":"https://api.github.com/repos/projectatomic/atomic-reactor/statuses/f9eb632b3a89dd2a9cc4345299eb4541a775744d"}}}}
{"actor":{"display_login":"twaugh"}}