{"action":"opened","number":356,"pull_request":{"url":"https://api.github.com/repos/csc/Hanlon/pulls/356","id":31579082,"html_url":"https://github.com/csc/Hanlon/pull/356","diff_url":"https://github.com/csc/Hanlon/pull/356.diff","patch_url":"https://github.com/csc/Hanlon/pull/356.patch","issue_url":"https://api.github.com/repos/csc/Hanlon/issues/356","number":356,"state":"open","locked":false,"title":"Adds an \"in-memory\" CoreOS model to Hanlon","user":{"login":"tjmcs","id":1375734,"avatar_url":"https://avatars.githubusercontent.com/u/1375734?v=3","gravatar_id":"","url":"https://api.github.com/users/tjmcs","html_url":"https://github.com/tjmcs","followers_url":"https://api.github.com/users/tjmcs/followers","following_url":"https://api.github.com/users/tjmcs/following{/other_user}","gists_url":"https://api.github.com/users/tjmcs/gists{/gist_id}","starred_url":"https://api.github.com/users/tjmcs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tjmcs/subscriptions","organizations_url":"https://api.github.com/users/tjmcs/orgs","repos_url":"https://api.github.com/users/tjmcs/repos","events_url":"https://api.github.com/users/tjmcs/events{/privacy}","received_events_url":"https://api.github.com/users/tjmcs/received_events","type":"User","site_admin":false},"body":"This PR adds a new `CoreosInMemory` model to Hanlon (which extends a new `InMemory` model type, which itself extends the `Base` model type). We've also added a new pair of methods to the `Utility` module used across Hanlon that can be used to convert a BSON::OrderedHash (the data type returned from MongoDB to Hanlon) to a regular Ruby Hash. This method is needed to create a 'clean' YAML for use as the `cloud-config` that is passed into the CoreOS instance that a node boots into when bound to the new `CoreosInMemory` model. Without this method, the cloud-config passed through to the CoreOS instance looks like this:\r\n```yaml\r\n#cloud-config\r\n--- !ruby/hash:BSON::OrderedHash\r\ncoreos: !ruby/hash:BSON::OrderedHash\r\n  units:\r\n  - !ruby/hash:BSON::OrderedHash\r\n    name: etcd.service\r\n    command: start\r\n  - !ruby/hash:BSON::OrderedHash\r\n    name: fleet.service\r\n    command: start\r\nssh_authorized_keys:\r\n- ssh-rsa AAAAB3N...[your RSA public key goes here]\r\nhostname: coreosnode1\r\n```\r\nbut with this code, the YAML generated is something that CoreOS can actually parse (without Ruby):\r\n```yaml\r\n#cloud-config\r\n---\r\ncoreos:\r\n  units:\r\n  - name: etcd.service\r\n    command: start\r\n  - name: fleet.service\r\n    command: start\r\nssh_authorized_keys:\r\n- ssh-rsa AAAAB3N...[your RSA public key goes here]\r\nhostname: coreosnode1\r\n```","created_at":"2015-03-20T00:24:09Z","updated_at":"2015-03-20T00:24:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e2cf1ffe6ddfb97412a468deea14766ccf933e91","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/csc/Hanlon/pulls/356/commits","review_comments_url":"https://api.github.com/repos/csc/Hanlon/pulls/356/comments","review_comment_url":"https://api.github.com/repos/csc/Hanlon/pulls/comments{/number}","comments_url":"https://api.github.com/repos/csc/Hanlon/issues/356/comments","statuses_url":"https://api.github.com/repos/csc/Hanlon/statuses/d7ff1e295ad12fae8eb3b1dbd5624272b24f1134","head":{"label":"tjmcs:tb/add-in-mem-coreos-model","ref":"tb/add-in-mem-coreos-model","sha":"d7ff1e295ad12fae8eb3b1dbd5624272b24f1134","user":{"login":"tjmcs","id":1375734,"avatar_url":"https://avatars.githubusercontent.com/u/1375734?v=3","gravatar_id":"","url":"https://api.github.com/users/tjmcs","html_url":"https://github.com/tjmcs","followers_url":"https://api.github.com/users/tjmcs/followers","following_url":"https://api.github.com/users/tjmcs/following{/other_user}","gists_url":"https://api.github.com/users/tjmcs/gists{/gist_id}","starred_url":"https://api.github.com/users/tjmcs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tjmcs/subscriptions","organizations_url":"https://api.github.com/users/tjmcs/orgs","repos_url":"https://api.github.com/users/tjmcs/repos","events_url":"https://api.github.com/users/tjmcs/events{/privacy}","received_events_url":"https://api.github.com/users/tjmcs/received_events","type":"User","site_admin":false},"repo":{"id":20059044,"name":"Hanlon","full_name":"tjmcs/Hanlon","owner":{"login":"tjmcs","id":1375734,"avatar_url":"https://avatars.githubusercontent.com/u/1375734?v=3","gravatar_id":"","url":"https://api.github.com/users/tjmcs","html_url":"https://github.com/tjmcs","followers_url":"https://api.github.com/users/tjmcs/followers","following_url":"https://api.github.com/users/tjmcs/following{/other_user}","gists_url":"https://api.github.com/users/tjmcs/gists{/gist_id}","starred_url":"https://api.github.com/users/tjmcs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tjmcs/subscriptions","organizations_url":"https://api.github.com/users/tjmcs/orgs","repos_url":"https://api.github.com/users/tjmcs/repos","events_url":"https://api.github.com/users/tjmcs/events{/privacy}","received_events_url":"https://api.github.com/users/tjmcs/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tjmcs/Hanlon","description":"Next-generation automation software for bare-metal and virtual server provisioning.","fork":true,"url":"https://api.github.com/repos/tjmcs/Hanlon","forks_url":"https://api.github.com/repos/tjmcs/Hanlon/forks","keys_url":"https://api.github.com/repos/tjmcs/Hanlon/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tjmcs/Hanlon/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tjmcs/Hanlon/teams","hooks_url":"https://api.github.com/repos/tjmcs/Hanlon/hooks","issue_events_url":"https://api.github.com/repos/tjmcs/Hanlon/issues/events{/number}","events_url":"https://api.github.com/repos/tjmcs/Hanlon/events","assignees_url":"https://api.github.com/repos/tjmcs/Hanlon/assignees{/user}","branches_url":"https://api.github.com/repos/tjmcs/Hanlon/branches{/branch}","tags_url":"https://api.github.com/repos/tjmcs/Hanlon/tags","blobs_url":"https://api.github.com/repos/tjmcs/Hanlon/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tjmcs/Hanlon/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tjmcs/Hanlon/git/refs{/sha}","trees_url":"https://api.github.com/repos/tjmcs/Hanlon/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tjmcs/Hanlon/statuses/{sha}","languages_url":"https://api.github.com/repos/tjmcs/Hanlon/languages","stargazers_url":"https://api.github.com/repos/tjmcs/Hanlon/stargazers","contributors_url":"https://api.github.com/repos/tjmcs/Hanlon/contributors","subscribers_url":"https://api.github.com/repos/tjmcs/Hanlon/subscribers","subscription_url":"https://api.github.com/repos/tjmcs/Hanlon/subscription","commits_url":"https://api.github.com/repos/tjmcs/Hanlon/commits{/sha}","git_commits_url":"https://api.github.com/repos/tjmcs/Hanlon/git/commits{/sha}","comments_url":"https://api.github.com/repos/tjmcs/Hanlon/comments{/number}","issue_comment_url":"https://api.github.com/repos/tjmcs/Hanlon/issues/comments{/number}","contents_url":"https://api.github.com/repos/tjmcs/Hanlon/contents/{+path}","compare_url":"https://api.github.com/repos/tjmcs/Hanlon/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tjmcs/Hanlon/merges","archive_url":"https://api.github.com/repos/tjmcs/Hanlon/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tjmcs/Hanlon/downloads","issues_url":"https://api.github.com/repos/tjmcs/Hanlon/issues{/number}","pulls_url":"https://api.github.com/repos/tjmcs/Hanlon/pulls{/number}","milestones_url":"https://api.github.com/repos/tjmcs/Hanlon/milestones{/number}","notifications_url":"https://api.github.com/repos/tjmcs/Hanlon/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tjmcs/Hanlon/labels{/name}","releases_url":"https://api.github.com/repos/tjmcs/Hanlon/releases{/id}","created_at":"2014-05-22T11:47:14Z","updated_at":"2015-03-18T19:57:00Z","pushed_at":"2015-03-20T00:14:57Z","git_url":"git://github.com/tjmcs/Hanlon.git","ssh_url":"git@github.com:tjmcs/Hanlon.git","clone_url":"https://github.com/tjmcs/Hanlon.git","svn_url":"https://github.com/tjmcs/Hanlon","homepage":"","size":5228,"stargazers_count":0,"watchers_count":0,"language":"Ruby","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":"csc:master","ref":"master","sha":"e48f18d4e1d5162ef8ef686741a72f67fafbe945","user":{"login":"csc","id":6401996,"avatar_url":"https://avatars.githubusercontent.com/u/6401996?v=3","gravatar_id":"","url":"https://api.github.com/users/csc","html_url":"https://github.com/csc","followers_url":"https://api.github.com/users/csc/followers","following_url":"https://api.github.com/users/csc/following{/other_user}","gists_url":"https://api.github.com/users/csc/gists{/gist_id}","starred_url":"https://api.github.com/users/csc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/csc/subscriptions","organizations_url":"https://api.github.com/users/csc/orgs","repos_url":"https://api.github.com/users/csc/repos","events_url":"https://api.github.com/users/csc/events{/privacy}","received_events_url":"https://api.github.com/users/csc/received_events","type":"Organization","site_admin":false},"repo":{"id":17629871,"name":"Hanlon","full_name":"csc/Hanlon","owner":{"login":"csc","id":6401996,"avatar_url":"https://avatars.githubusercontent.com/u/6401996?v=3","gravatar_id":"","url":"https://api.github.com/users/csc","html_url":"https://github.com/csc","followers_url":"https://api.github.com/users/csc/followers","following_url":"https://api.github.com/users/csc/following{/other_user}","gists_url":"https://api.github.com/users/csc/gists{/gist_id}","starred_url":"https://api.github.com/users/csc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/csc/subscriptions","organizations_url":"https://api.github.com/users/csc/orgs","repos_url":"https://api.github.com/users/csc/repos","events_url":"https://api.github.com/users/csc/events{/privacy}","received_events_url":"https://api.github.com/users/csc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/csc/Hanlon","description":"Next-generation automation software for bare-metal and virtual server provisioning.","fork":false,"url":"https://api.github.com/repos/csc/Hanlon","forks_url":"https://api.github.com/repos/csc/Hanlon/forks","keys_url":"https://api.github.com/repos/csc/Hanlon/keys{/key_id}","collaborators_url":"https://api.github.com/repos/csc/Hanlon/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/csc/Hanlon/teams","hooks_url":"https://api.github.com/repos/csc/Hanlon/hooks","issue_events_url":"https://api.github.com/repos/csc/Hanlon/issues/events{/number}","events_url":"https://api.github.com/repos/csc/Hanlon/events","assignees_url":"https://api.github.com/repos/csc/Hanlon/assignees{/user}","branches_url":"https://api.github.com/repos/csc/Hanlon/branches{/branch}","tags_url":"https://api.github.com/repos/csc/Hanlon/tags","blobs_url":"https://api.github.com/repos/csc/Hanlon/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/csc/Hanlon/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/csc/Hanlon/git/refs{/sha}","trees_url":"https://api.github.com/repos/csc/Hanlon/git/trees{/sha}","statuses_url":"https://api.github.com/repos/csc/Hanlon/statuses/{sha}","languages_url":"https://api.github.com/repos/csc/Hanlon/languages","stargazers_url":"https://api.github.com/repos/csc/Hanlon/stargazers","contributors_url":"https://api.github.com/repos/csc/Hanlon/contributors","subscribers_url":"https://api.github.com/repos/csc/Hanlon/subscribers","subscription_url":"https://api.github.com/repos/csc/Hanlon/subscription","commits_url":"https://api.github.com/repos/csc/Hanlon/commits{/sha}","git_commits_url":"https://api.github.com/repos/csc/Hanlon/git/commits{/sha}","comments_url":"https://api.github.com/repos/csc/Hanlon/comments{/number}","issue_comment_url":"https://api.github.com/repos/csc/Hanlon/issues/comments{/number}","contents_url":"https://api.github.com/repos/csc/Hanlon/contents/{+path}","compare_url":"https://api.github.com/repos/csc/Hanlon/compare/{base}...{head}","merges_url":"https://api.github.com/repos/csc/Hanlon/merges","archive_url":"https://api.github.com/repos/csc/Hanlon/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/csc/Hanlon/downloads","issues_url":"https://api.github.com/repos/csc/Hanlon/issues{/number}","pulls_url":"https://api.github.com/repos/csc/Hanlon/pulls{/number}","milestones_url":"https://api.github.com/repos/csc/Hanlon/milestones{/number}","notifications_url":"https://api.github.com/repos/csc/Hanlon/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/csc/Hanlon/labels{/name}","releases_url":"https://api.github.com/repos/csc/Hanlon/releases{/id}","created_at":"2014-03-11T12:40:48Z","updated_at":"2015-03-18T19:31:23Z","pushed_at":"2015-03-20T00:24:10Z","git_url":"git://github.com/csc/Hanlon.git","ssh_url":"git@github.com:csc/Hanlon.git","clone_url":"https://github.com/csc/Hanlon.git","svn_url":"https://github.com/csc/Hanlon","homepage":"","size":6082,"stargazers_count":66,"watchers_count":66,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":26,"mirror_url":null,"open_issues_count":60,"forks":26,"open_issues":60,"watchers":66,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/csc/Hanlon/pulls/356"},"html":{"href":"https://github.com/csc/Hanlon/pull/356"},"issue":{"href":"https://api.github.com/repos/csc/Hanlon/issues/356"},"comments":{"href":"https://api.github.com/repos/csc/Hanlon/issues/356/comments"},"review_comments":{"href":"https://api.github.com/repos/csc/Hanlon/pulls/356/comments"},"review_comment":{"href":"https://api.github.com/repos/csc/Hanlon/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/csc/Hanlon/pulls/356/commits"},"statuses":{"href":"https://api.github.com/repos/csc/Hanlon/statuses/d7ff1e295ad12fae8eb3b1dbd5624272b24f1134"}},"merged":false,"mergeable":true,"mergeable_state":"clean","merged_by":null,"comments":0,"review_comments":0,"commits":3,"additions":270,"deletions":5,"changed_files":9}}