GitHub PullRequestReviewCommentEvent at 2014-09-09 17:25:09
Repository: robottelo
Actor: Ichimonji10
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/omaciel/robottelo/pulls/comments/17315034","id":17315034,"diff_hunk":"@@ -0,0 +1,178 @@\n+\"\"\"Utilities to create clients\n+\n+Clients are virtual machines provisioned on a ``provisioning_server``. All\n+virtual machine images are stored on the ``image_dir`` path on the provisioning\n+server.\n+\n+Make sure to configure the ``clients`` section on the configuration file. Also\n+make sure that the server have in place: the base images for rhel65 and rhel7,\n+snap-guest and its dependencies and the ``image_dir`` path created.\n+\n+\"\"\"\n+import logging\n+import os\n+import time\n+\n+from robottelo.common import conf, ssh\n+\n+\n+BASE_IMAGES = ('rhel7', 'rhel65')\n+\n+logger = logging.getLogger(__name__)\n+\n+\n+class VirtualMachineError(Exception):\n+    \"\"\"Exception raised for failed virtual machine management operations\"\"\"\n+\n+\n+class VirtualMachine(object):\n+    \"\"\"Manages a virtual machine to allow client provisioning for robottelo\n+\n+    It expects that base images listed on ``BASE_IMAGES`` are created and\n+    snap-guest is setup on the provisioning server.\n+\n+    This also can be used as a context manager::\n+\n+        with VirtualMachine() as vm:\n+            result = vm.run('ls')\n+            out = result.stdout\n+\n+    Make sure to call :meth:`destroy` to stop and clean the image on the\n+    provisioning server, otherwise the virtual machine and its image will stay\n+    on the server consuming hardware resources.\n+\n+    Is possible to customize the ``provisioning_server`` and ``image_dir`` as","path":"robottelo/vm.py","position":44,"original_position":44,"commit_id":"4c0e81ccb09351a3ad991eba3fa11617279e92e2","original_commit_id":"a94a8c04879c9562f522f9afccc69716ae626c34","user":{"login":"Ichimonji10","id":1012989,"avatar_url":"https://avatars.githubusercontent.com/u/1012989?v=2","gravatar_id":"0d55b0822baba206e15373fbe457bf70","url":"https://api.github.com/users/Ichimonji10","html_url":"https://github.com/Ichimonji10","followers_url":"https://api.github.com/users/Ichimonji10/followers","following_url":"https://api.github.com/users/Ichimonji10/following{/other_user}","gists_url":"https://api.github.com/users/Ichimonji10/gists{/gist_id}","starred_url":"https://api.github.com/users/Ichimonji10/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ichimonji10/subscriptions","organizations_url":"https://api.github.com/users/Ichimonji10/orgs","repos_url":"https://api.github.com/users/Ichimonji10/repos","events_url":"https://api.github.com/users/Ichimonji10/events{/privacy}","received_events_url":"https://api.github.com/users/Ichimonji10/received_events","type":"User","site_admin":false},"body":":wink:","created_at":"2014-09-09T17:25:09Z","updated_at":"2014-09-09T17:25:09Z","html_url":"https://github.com/omaciel/robottelo/pull/1322#discussion_r17315034","pull_request_url":"https://api.github.com/repos/omaciel/robottelo/pulls/1322","_links":{"self":{"href":"https://api.github.com/repos/omaciel/robottelo/pulls/comments/17315034"},"html":{"href":"https://github.com/omaciel/robottelo/pull/1322#discussion_r17315034"},"pull_request":{"href":"https://api.github.com/repos/omaciel/robottelo/pulls/1322"}}},"pull_request":{"url":"https://api.github.com/repos/omaciel/robottelo/pulls/1322","id":20956431,"html_url":"https://github.com/omaciel/robottelo/pull/1322","diff_url":"https://github.com/omaciel/robottelo/pull/1322.diff","patch_url":"https://github.com/omaciel/robottelo/pull/1322.patch","issue_url":"https://api.github.com/repos/omaciel/robottelo/issues/1322","number":1322,"state":"open","locked":false,"title":"Add clients provisioning feature","user":{"login":"elyezer","id":48132,"avatar_url":"https://avatars.githubusercontent.com/u/48132?v=2","gravatar_id":"62fbd1865935d1aad67f35749b6113a7","url":"https://api.github.com/users/elyezer","html_url":"https://github.com/elyezer","followers_url":"https://api.github.com/users/elyezer/followers","following_url":"https://api.github.com/users/elyezer/following{/other_user}","gists_url":"https://api.github.com/users/elyezer/gists{/gist_id}","starred_url":"https://api.github.com/users/elyezer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elyezer/subscriptions","organizations_url":"https://api.github.com/users/elyezer/orgs","repos_url":"https://api.github.com/users/elyezer/repos","events_url":"https://api.github.com/users/elyezer/events{/privacy}","received_events_url":"https://api.github.com/users/elyezer/received_events","type":"User","site_admin":false},"body":"The clients provisioning feature will allow create clients to be used on\r\ntests that needs another machine to consume some content.\r\n\r\nAlso this improve the ssh module to allow specify the machine where to\r\nrun a command. Improved logging to show what machine the command was\r\nexecuted (inspired by Fabric).\r\n\r\nFinally was added tests for the new robotello.vm module and properly\r\nadded entries for added modules in the docs.\r\n\r\nBonus: refactored logging on the ssh module.","created_at":"2014-09-09T13:54:22Z","updated_at":"2014-09-09T17:25:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ec02ebf256c3fa6866d6e23725c2c369efdb9c10","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/omaciel/robottelo/pulls/1322/commits","review_comments_url":"https://api.github.com/repos/omaciel/robottelo/pulls/1322/comments","review_comment_url":"https://api.github.com/repos/omaciel/robottelo/pulls/comments/{number}","comments_url":"https://api.github.com/repos/omaciel/robottelo/issues/1322/comments","statuses_url":"https://api.github.com/repos/omaciel/robottelo/statuses/4c0e81ccb09351a3ad991eba3fa11617279e92e2","head":{"label":"elyezer:clients-provisioning","ref":"clients-provisioning","sha":"4c0e81ccb09351a3ad991eba3fa11617279e92e2","user":{"login":"elyezer","id":48132,"avatar_url":"https://avatars.githubusercontent.com/u/48132?v=2","gravatar_id":"62fbd1865935d1aad67f35749b6113a7","url":"https://api.github.com/users/elyezer","html_url":"https://github.com/elyezer","followers_url":"https://api.github.com/users/elyezer/followers","following_url":"https://api.github.com/users/elyezer/following{/other_user}","gists_url":"https://api.github.com/users/elyezer/gists{/gist_id}","starred_url":"https://api.github.com/users/elyezer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elyezer/subscriptions","organizations_url":"https://api.github.com/users/elyezer/orgs","repos_url":"https://api.github.com/users/elyezer/repos","events_url":"https://api.github.com/users/elyezer/events{/privacy}","received_events_url":"https://api.github.com/users/elyezer/received_events","type":"User","site_admin":false},"repo":{"id":14159745,"name":"robottelo","full_name":"elyezer/robottelo","owner":{"login":"elyezer","id":48132,"avatar_url":"https://avatars.githubusercontent.com/u/48132?v=2","gravatar_id":"62fbd1865935d1aad67f35749b6113a7","url":"https://api.github.com/users/elyezer","html_url":"https://github.com/elyezer","followers_url":"https://api.github.com/users/elyezer/followers","following_url":"https://api.github.com/users/elyezer/following{/other_user}","gists_url":"https://api.github.com/users/elyezer/gists{/gist_id}","starred_url":"https://api.github.com/users/elyezer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elyezer/subscriptions","organizations_url":"https://api.github.com/users/elyezer/orgs","repos_url":"https://api.github.com/users/elyezer/repos","events_url":"https://api.github.com/users/elyezer/events{/privacy}","received_events_url":"https://api.github.com/users/elyezer/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/elyezer/robottelo","description":"An automation testing framework for the Foreman project.","fork":true,"url":"https://api.github.com/repos/elyezer/robottelo","forks_url":"https://api.github.com/repos/elyezer/robottelo/forks","keys_url":"https://api.github.com/repos/elyezer/robottelo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/elyezer/robottelo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/elyezer/robottelo/teams","hooks_url":"https://api.github.com/repos/elyezer/robottelo/hooks","issue_events_url":"https://api.github.com/repos/elyezer/robottelo/issues/events{/number}","events_url":"https://api.github.com/repos/elyezer/robottelo/events","assignees_url":"https://api.github.com/repos/elyezer/robottelo/assignees{/user}","branches_url":"https://api.github.com/repos/elyezer/robottelo/branches{/branch}","tags_url":"https://api.github.com/repos/elyezer/robottelo/tags","blobs_url":"https://api.github.com/repos/elyezer/robottelo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/elyezer/robottelo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/elyezer/robottelo/git/refs{/sha}","trees_url":"https://api.github.com/repos/elyezer/robottelo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/elyezer/robottelo/statuses/{sha}","languages_url":"https://api.github.com/repos/elyezer/robottelo/languages","stargazers_url":"https://api.github.com/repos/elyezer/robottelo/stargazers","contributors_url":"https://api.github.com/repos/elyezer/robottelo/contributors","subscribers_url":"https://api.github.com/repos/elyezer/robottelo/subscribers","subscription_url":"https://api.github.com/repos/elyezer/robottelo/subscription","commits_url":"https://api.github.com/repos/elyezer/robottelo/commits{/sha}","git_commits_url":"https://api.github.com/repos/elyezer/robottelo/git/commits{/sha}","comments_url":"https://api.github.com/repos/elyezer/robottelo/comments{/number}","issue_comment_url":"https://api.github.com/repos/elyezer/robottelo/issues/comments/{number}","contents_url":"https://api.github.com/repos/elyezer/robottelo/contents/{+path}","compare_url":"https://api.github.com/repos/elyezer/robottelo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/elyezer/robottelo/merges","archive_url":"https://api.github.com/repos/elyezer/robottelo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/elyezer/robottelo/downloads","issues_url":"https://api.github.com/repos/elyezer/robottelo/issues{/number}","pulls_url":"https://api.github.com/repos/elyezer/robottelo/pulls{/number}","milestones_url":"https://api.github.com/repos/elyezer/robottelo/milestones{/number}","notifications_url":"https://api.github.com/repos/elyezer/robottelo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/elyezer/robottelo/labels{/name}","releases_url":"https://api.github.com/repos/elyezer/robottelo/releases{/id}","created_at":"2013-11-06T01:31:06Z","updated_at":"2014-07-03T17:49:08Z","pushed_at":"2014-09-09T17:23:56Z","git_url":"git://github.com/elyezer/robottelo.git","ssh_url":"git@github.com:elyezer/robottelo.git","clone_url":"https://github.com/elyezer/robottelo.git","svn_url":"https://github.com/elyezer/robottelo","homepage":"","size":8111,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"omaciel:master","ref":"master","sha":"8ba90a10c59ef8ceb21ddcb3782a9f2da3e2b0e4","user":{"login":"omaciel","id":53362,"avatar_url":"https://avatars.githubusercontent.com/u/53362?v=2","gravatar_id":"5be9b08cd178f87cca6de19f00a9992c","url":"https://api.github.com/users/omaciel","html_url":"https://github.com/omaciel","followers_url":"https://api.github.com/users/omaciel/followers","following_url":"https://api.github.com/users/omaciel/following{/other_user}","gists_url":"https://api.github.com/users/omaciel/gists{/gist_id}","starred_url":"https://api.github.com/users/omaciel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/omaciel/subscriptions","organizations_url":"https://api.github.com/users/omaciel/orgs","repos_url":"https://api.github.com/users/omaciel/repos","events_url":"https://api.github.com/users/omaciel/events{/privacy}","received_events_url":"https://api.github.com/users/omaciel/received_events","type":"User","site_admin":false},"repo":{"id":4000279,"name":"robottelo","full_name":"omaciel/robottelo","owner":{"login":"omaciel","id":53362,"avatar_url":"https://avatars.githubusercontent.com/u/53362?v=2","gravatar_id":"5be9b08cd178f87cca6de19f00a9992c","url":"https://api.github.com/users/omaciel","html_url":"https://github.com/omaciel","followers_url":"https://api.github.com/users/omaciel/followers","following_url":"https://api.github.com/users/omaciel/following{/other_user}","gists_url":"https://api.github.com/users/omaciel/gists{/gist_id}","starred_url":"https://api.github.com/users/omaciel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/omaciel/subscriptions","organizations_url":"https://api.github.com/users/omaciel/orgs","repos_url":"https://api.github.com/users/omaciel/repos","events_url":"https://api.github.com/users/omaciel/events{/privacy}","received_events_url":"https://api.github.com/users/omaciel/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/omaciel/robottelo","description":"An automation testing framework for the Katello project.","fork":false,"url":"https://api.github.com/repos/omaciel/robottelo","forks_url":"https://api.github.com/repos/omaciel/robottelo/forks","keys_url":"https://api.github.com/repos/omaciel/robottelo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/omaciel/robottelo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/omaciel/robottelo/teams","hooks_url":"https://api.github.com/repos/omaciel/robottelo/hooks","issue_events_url":"https://api.github.com/repos/omaciel/robottelo/issues/events{/number}","events_url":"https://api.github.com/repos/omaciel/robottelo/events","assignees_url":"https://api.github.com/repos/omaciel/robottelo/assignees{/user}","branches_url":"https://api.github.com/repos/omaciel/robottelo/branches{/branch}","tags_url":"https://api.github.com/repos/omaciel/robottelo/tags","blobs_url":"https://api.github.com/repos/omaciel/robottelo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/omaciel/robottelo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/omaciel/robottelo/git/refs{/sha}","trees_url":"https://api.github.com/repos/omaciel/robottelo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/omaciel/robottelo/statuses/{sha}","languages_url":"https://api.github.com/repos/omaciel/robottelo/languages","stargazers_url":"https://api.github.com/repos/omaciel/robottelo/stargazers","contributors_url":"https://api.github.com/repos/omaciel/robottelo/contributors","subscribers_url":"https://api.github.com/repos/omaciel/robottelo/subscribers","subscription_url":"https://api.github.com/repos/omaciel/robottelo/subscription","commits_url":"https://api.github.com/repos/omaciel/robottelo/commits{/sha}","git_commits_url":"https://api.github.com/repos/omaciel/robottelo/git/commits{/sha}","comments_url":"https://api.github.com/repos/omaciel/robottelo/comments{/number}","issue_comment_url":"https://api.github.com/repos/omaciel/robottelo/issues/comments/{number}","contents_url":"https://api.github.com/repos/omaciel/robottelo/contents/{+path}","compare_url":"https://api.github.com/repos/omaciel/robottelo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/omaciel/robottelo/merges","archive_url":"https://api.github.com/repos/omaciel/robottelo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/omaciel/robottelo/downloads","issues_url":"https://api.github.com/repos/omaciel/robottelo/issues{/number}","pulls_url":"https://api.github.com/repos/omaciel/robottelo/pulls{/number}","milestones_url":"https://api.github.com/repos/omaciel/robottelo/milestones{/number}","notifications_url":"https://api.github.com/repos/omaciel/robottelo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/omaciel/robottelo/labels{/name}","releases_url":"https://api.github.com/repos/omaciel/robottelo/releases{/id}","created_at":"2012-04-12T01:36:39Z","updated_at":"2014-09-02T19:27:57Z","pushed_at":"2014-09-09T16:59:13Z","git_url":"git://github.com/omaciel/robottelo.git","ssh_url":"git@github.com:omaciel/robottelo.git","clone_url":"https://github.com/omaciel/robottelo.git","svn_url":"https://github.com/omaciel/robottelo","homepage":null,"size":21037,"stargazers_count":16,"watchers_count":16,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":18,"mirror_url":null,"open_issues_count":101,"forks":18,"open_issues":101,"watchers":16,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/omaciel/robottelo/pulls/1322"},"html":{"href":"https://github.com/omaciel/robottelo/pull/1322"},"issue":{"href":"https://api.github.com/repos/omaciel/robottelo/issues/1322"},"comments":{"href":"https://api.github.com/repos/omaciel/robottelo/issues/1322/comments"},"review_comments":{"href":"https://api.github.com/repos/omaciel/robottelo/pulls/1322/comments"},"review_comment":{"href":"https://api.github.com/repos/omaciel/robottelo/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/omaciel/robottelo/pulls/1322/commits"},"statuses":{"href":"https://api.github.com/repos/omaciel/robottelo/statuses/4c0e81ccb09351a3ad991eba3fa11617279e92e2"}}}}