{"action":"created","comment":{"url":"https://api.github.com/repos/Qualtrax/QualtraxCloud/pulls/comments/31448203","id":31448203,"diff_hunk":"@@ -0,0 +1,156 @@\n+#!/usr/bin/env python\n+\"\"\"\n+Script to automate running PS Scripts on windows\n+machines\n+\"\"\"\n+import sys\n+import getpass\n+import winrm\n+from winrm.exceptions import WinRMTransportError, UnauthorizedError\n+\n+NUMBER_OF_PARAMETERS = 2\n+COMP_LIST_PATH = 1\n+SCRIPT_PATH = 2\n+NUMBER_OF_FAILED_ATTEMPTS = 3\n+INVALID_ATTEMPTS = 0\n+\n+def main():\n+    \"\"\"\n+    Calls all helper methods\n+    \"\"\"\n+    check_arguments()\n+    host_filepath = sys.argv[COMP_LIST_PATH]\n+    ps_script_path = sys.argv[SCRIPT_PATH]\n+\n+    input_file = open(host_filepath, \"r\", 1)\n+    script_text = extract_script(ps_script_path)\n+\n+    computers_list = {}\n+    computers_list = parse_input_file(input_file)\n+\n+    gather_and_run_inputs(computers_list, script_text)\n+\n+    input_file.close()\n+    check_if_closed(input_file)","path":"remote_ps.py","position":34,"original_position":34,"commit_id":"42d529f206f02fcba96bcef2d5b959b076eb908c","original_commit_id":"42d529f206f02fcba96bcef2d5b959b076eb908c","user":{"login":"efouts","id":1428145,"avatar_url":"https://avatars.githubusercontent.com/u/1428145?v=3","gravatar_id":"","url":"https://api.github.com/users/efouts","html_url":"https://github.com/efouts","followers_url":"https://api.github.com/users/efouts/followers","following_url":"https://api.github.com/users/efouts/following{/other_user}","gists_url":"https://api.github.com/users/efouts/gists{/gist_id}","starred_url":"https://api.github.com/users/efouts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/efouts/subscriptions","organizations_url":"https://api.github.com/users/efouts/orgs","repos_url":"https://api.github.com/users/efouts/repos","events_url":"https://api.github.com/users/efouts/events{/privacy}","received_events_url":"https://api.github.com/users/efouts/received_events","type":"User","site_admin":false},"body":"How about rolling input_file.close() into the check_if_closed method? Youll probably want to rename the method at that point, but it cleans up the act of cleaning up.","created_at":"2015-06-01T17:24:38Z","updated_at":"2015-06-01T17:24:38Z","html_url":"https://github.com/Qualtrax/QualtraxCloud/pull/2#discussion_r31448203","pull_request_url":"https://api.github.com/repos/Qualtrax/QualtraxCloud/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/Qualtrax/QualtraxCloud/pulls/comments/31448203"},"html":{"href":"https://github.com/Qualtrax/QualtraxCloud/pull/2#discussion_r31448203"},"pull_request":{"href":"https://api.github.com/repos/Qualtrax/QualtraxCloud/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/Qualtrax/QualtraxCloud/pulls/2","id":36638071,"html_url":"https://github.com/Qualtrax/QualtraxCloud/pull/2","diff_url":"https://github.com/Qualtrax/QualtraxCloud/pull/2.diff","patch_url":"https://github.com/Qualtrax/QualtraxCloud/pull/2.patch","issue_url":"https://api.github.com/repos/Qualtrax/QualtraxCloud/issues/2","number":2,"state":"open","locked":false,"title":"Remote ps","user":{"login":"ImpulseChimp","id":1214565,"avatar_url":"https://avatars.githubusercontent.com/u/1214565?v=3","gravatar_id":"","url":"https://api.github.com/users/ImpulseChimp","html_url":"https://github.com/ImpulseChimp","followers_url":"https://api.github.com/users/ImpulseChimp/followers","following_url":"https://api.github.com/users/ImpulseChimp/following{/other_user}","gists_url":"https://api.github.com/users/ImpulseChimp/gists{/gist_id}","starred_url":"https://api.github.com/users/ImpulseChimp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ImpulseChimp/subscriptions","organizations_url":"https://api.github.com/users/ImpulseChimp/orgs","repos_url":"https://api.github.com/users/ImpulseChimp/repos","events_url":"https://api.github.com/users/ImpulseChimp/events{/privacy}","received_events_url":"https://api.github.com/users/ImpulseChimp/received_events","type":"User","site_admin":false},"body":"@efouts All changes have been made by lucus and I to update and improve the remote_ps.py script.\r\nIt is also 10/10 through pylint. This represents the cleaned code for what we created last Thursday and the setup to allow more features to be added as needed.","created_at":"2015-06-01T15:08:56Z","updated_at":"2015-06-01T17:24:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"82ba408782f7a82d32284dbb45410c0c86438225","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Qualtrax/QualtraxCloud/pulls/2/commits","review_comments_url":"https://api.github.com/repos/Qualtrax/QualtraxCloud/pulls/2/comments","review_comment_url":"https://api.github.com/repos/Qualtrax/QualtraxCloud/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Qualtrax/QualtraxCloud/issues/2/comments","statuses_url":"https://api.github.com/repos/Qualtrax/QualtraxCloud/statuses/42d529f206f02fcba96bcef2d5b959b076eb908c","head":{"label":"Qualtrax:remote-ps","ref":"remote-ps","sha":"42d529f206f02fcba96bcef2d5b959b076eb908c","user":{"login":"Qualtrax","id":6817068,"avatar_url":"https://avatars.githubusercontent.com/u/6817068?v=3","gravatar_id":"","url":"https://api.github.com/users/Qualtrax","html_url":"https://github.com/Qualtrax","followers_url":"https://api.github.com/users/Qualtrax/followers","following_url":"https://api.github.com/users/Qualtrax/following{/other_user}","gists_url":"https://api.github.com/users/Qualtrax/gists{/gist_id}","starred_url":"https://api.github.com/users/Qualtrax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Qualtrax/subscriptions","organizations_url":"https://api.github.com/users/Qualtrax/orgs","repos_url":"https://api.github.com/users/Qualtrax/repos","events_url":"https://api.github.com/users/Qualtrax/events{/privacy}","received_events_url":"https://api.github.com/users/Qualtrax/received_events","type":"Organization","site_admin":false},"repo":{"id":22998128,"name":"QualtraxCloud","full_name":"Qualtrax/QualtraxCloud","owner":{"login":"Qualtrax","id":6817068,"avatar_url":"https://avatars.githubusercontent.com/u/6817068?v=3","gravatar_id":"","url":"https://api.github.com/users/Qualtrax","html_url":"https://github.com/Qualtrax","followers_url":"https://api.github.com/users/Qualtrax/followers","following_url":"https://api.github.com/users/Qualtrax/following{/other_user}","gists_url":"https://api.github.com/users/Qualtrax/gists{/gist_id}","starred_url":"https://api.github.com/users/Qualtrax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Qualtrax/subscriptions","organizations_url":"https://api.github.com/users/Qualtrax/orgs","repos_url":"https://api.github.com/users/Qualtrax/repos","events_url":"https://api.github.com/users/Qualtrax/events{/privacy}","received_events_url":"https://api.github.com/users/Qualtrax/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Qualtrax/QualtraxCloud","description":"Custom scripts or code created for Qualtrax cloud environment","fork":false,"url":"https://api.github.com/repos/Qualtrax/QualtraxCloud","forks_url":"https://api.github.com/repos/Qualtrax/QualtraxCloud/forks","keys_url":"https://api.github.com/repos/Qualtrax/QualtraxCloud/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Qualtrax/QualtraxCloud/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Qualtrax/QualtraxCloud/teams","hooks_url":"https://api.github.com/repos/Qualtrax/QualtraxCloud/hooks","issue_events_url":"https://api.github.com/repos/Qualtrax/QualtraxCloud/issues/events{/number}","events_url":"https://api.github.com/repos/Qualtrax/QualtraxCloud/events","assignees_url":"https://api.github.com/repos/Qualtrax/QualtraxCloud/assignees{/user}","branches_url":"https://api.github.com/repos/Qualtrax/QualtraxCloud/branches{/branch}","tags_url":"https://api.github.com/repos/Qualtrax/QualtraxCloud/tags","blobs_url":"https://api.github.com/repos/Qualtrax/QualtraxCloud/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Qualtrax/QualtraxCloud/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Qualtrax/QualtraxCloud/git/refs{/sha}","trees_url":"https://api.github.com/repos/Qualtrax/QualtraxCloud/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Qualtrax/QualtraxCloud/statuses/{sha}","languages_url":"https://api.github.com/repos/Qualtrax/QualtraxCloud/languages","stargazers_url":"https://api.github.com/repos/Qualtrax/QualtraxCloud/stargazers","contributors_url":"https://api.github.com/repos/Qualtrax/QualtraxCloud/contributors","subscribers_url":"https://api.github.com/repos/Qualtrax/QualtraxCloud/subscribers","subscription_url":"https://api.github.com/repos/Qualtrax/QualtraxCloud/subscription","commits_url":"https://api.github.com/repos/Qualtrax/QualtraxCloud/commits{/sha}","git_commits_url":"https://api.github.com/repos/Qualtrax/QualtraxCloud/git/commits{/sha}","comments_url":"https://api.github.com/repos/Qualtrax/QualtraxCloud/comments{/number}","issue_comment_url":"https://api.github.com/repos/Qualtrax/QualtraxCloud/issues/comments{/number}","contents_url":"https://api.github.com/repos/Qualtrax/QualtraxCloud/contents/{+path}","compare_url":"https://api.github.com/repos/Qualtrax/QualtraxCloud/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Qualtrax/QualtraxCloud/merges","archive_url":"https://api.github.com/repos/Qualtrax/QualtraxCloud/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Qualtrax/QualtraxCloud/downloads","issues_url":"https://api.github.com/repos/Qualtrax/QualtraxCloud/issues{/number}","pulls_url":"https://api.github.com/repos/Qualtrax/QualtraxCloud/pulls{/number}","milestones_url":"https://api.github.com/repos/Qualtrax/QualtraxCloud/milestones{/number}","notifications_url":"https://api.github.com/repos/Qualtrax/QualtraxCloud/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Qualtrax/QualtraxCloud/labels{/name}","releases_url":"https://api.github.com/repos/Qualtrax/QualtraxCloud/releases{/id}","created_at":"2014-08-15T17:55:33Z","updated_at":"2015-01-29T22:00:26Z","pushed_at":"2015-06-01T17:16:36Z","git_url":"git://github.com/Qualtrax/QualtraxCloud.git","ssh_url":"git@github.com:Qualtrax/QualtraxCloud.git","clone_url":"https://github.com/Qualtrax/QualtraxCloud.git","svn_url":"https://github.com/Qualtrax/QualtraxCloud","homepage":null,"size":262,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"Qualtrax:master","ref":"master","sha":"94679d82d99f92eb46d5cf4a8b12099b4586c479","user":{"login":"Qualtrax","id":6817068,"avatar_url":"https://avatars.githubusercontent.com/u/6817068?v=3","gravatar_id":"","url":"https://api.github.com/users/Qualtrax","html_url":"https://github.com/Qualtrax","followers_url":"https://api.github.com/users/Qualtrax/followers","following_url":"https://api.github.com/users/Qualtrax/following{/other_user}","gists_url":"https://api.github.com/users/Qualtrax/gists{/gist_id}","starred_url":"https://api.github.com/users/Qualtrax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Qualtrax/subscriptions","organizations_url":"https://api.github.com/users/Qualtrax/orgs","repos_url":"https://api.github.com/users/Qualtrax/repos","events_url":"https://api.github.com/users/Qualtrax/events{/privacy}","received_events_url":"https://api.github.com/users/Qualtrax/received_events","type":"Organization","site_admin":false},"repo":{"id":22998128,"name":"QualtraxCloud","full_name":"Qualtrax/QualtraxCloud","owner":{"login":"Qualtrax","id":6817068,"avatar_url":"https://avatars.githubusercontent.com/u/6817068?v=3","gravatar_id":"","url":"https://api.github.com/users/Qualtrax","html_url":"https://github.com/Qualtrax","followers_url":"https://api.github.com/users/Qualtrax/followers","following_url":"https://api.github.com/users/Qualtrax/following{/other_user}","gists_url":"https://api.github.com/users/Qualtrax/gists{/gist_id}","starred_url":"https://api.github.com/users/Qualtrax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Qualtrax/subscriptions","organizations_url":"https://api.github.com/users/Qualtrax/orgs","repos_url":"https://api.github.com/users/Qualtrax/repos","events_url":"https://api.github.com/users/Qualtrax/events{/privacy}","received_events_url":"https://api.github.com/users/Qualtrax/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Qualtrax/QualtraxCloud","description":"Custom scripts or code created for Qualtrax cloud environment","fork":false,"url":"https://api.github.com/repos/Qualtrax/QualtraxCloud","forks_url":"https://api.github.com/repos/Qualtrax/QualtraxCloud/forks","keys_url":"https://api.github.com/repos/Qualtrax/QualtraxCloud/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Qualtrax/QualtraxCloud/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Qualtrax/QualtraxCloud/teams","hooks_url":"https://api.github.com/repos/Qualtrax/QualtraxCloud/hooks","issue_events_url":"https://api.github.com/repos/Qualtrax/QualtraxCloud/issues/events{/number}","events_url":"https://api.github.com/repos/Qualtrax/QualtraxCloud/events","assignees_url":"https://api.github.com/repos/Qualtrax/QualtraxCloud/assignees{/user}","branches_url":"https://api.github.com/repos/Qualtrax/QualtraxCloud/branches{/branch}","tags_url":"https://api.github.com/repos/Qualtrax/QualtraxCloud/tags","blobs_url":"https://api.github.com/repos/Qualtrax/QualtraxCloud/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Qualtrax/QualtraxCloud/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Qualtrax/QualtraxCloud/git/refs{/sha}","trees_url":"https://api.github.com/repos/Qualtrax/QualtraxCloud/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Qualtrax/QualtraxCloud/statuses/{sha}","languages_url":"https://api.github.com/repos/Qualtrax/QualtraxCloud/languages","stargazers_url":"https://api.github.com/repos/Qualtrax/QualtraxCloud/stargazers","contributors_url":"https://api.github.com/repos/Qualtrax/QualtraxCloud/contributors","subscribers_url":"https://api.github.com/repos/Qualtrax/QualtraxCloud/subscribers","subscription_url":"https://api.github.com/repos/Qualtrax/QualtraxCloud/subscription","commits_url":"https://api.github.com/repos/Qualtrax/QualtraxCloud/commits{/sha}","git_commits_url":"https://api.github.com/repos/Qualtrax/QualtraxCloud/git/commits{/sha}","comments_url":"https://api.github.com/repos/Qualtrax/QualtraxCloud/comments{/number}","issue_comment_url":"https://api.github.com/repos/Qualtrax/QualtraxCloud/issues/comments{/number}","contents_url":"https://api.github.com/repos/Qualtrax/QualtraxCloud/contents/{+path}","compare_url":"https://api.github.com/repos/Qualtrax/QualtraxCloud/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Qualtrax/QualtraxCloud/merges","archive_url":"https://api.github.com/repos/Qualtrax/QualtraxCloud/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Qualtrax/QualtraxCloud/downloads","issues_url":"https://api.github.com/repos/Qualtrax/QualtraxCloud/issues{/number}","pulls_url":"https://api.github.com/repos/Qualtrax/QualtraxCloud/pulls{/number}","milestones_url":"https://api.github.com/repos/Qualtrax/QualtraxCloud/milestones{/number}","notifications_url":"https://api.github.com/repos/Qualtrax/QualtraxCloud/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Qualtrax/QualtraxCloud/labels{/name}","releases_url":"https://api.github.com/repos/Qualtrax/QualtraxCloud/releases{/id}","created_at":"2014-08-15T17:55:33Z","updated_at":"2015-01-29T22:00:26Z","pushed_at":"2015-06-01T17:16:36Z","git_url":"git://github.com/Qualtrax/QualtraxCloud.git","ssh_url":"git@github.com:Qualtrax/QualtraxCloud.git","clone_url":"https://github.com/Qualtrax/QualtraxCloud.git","svn_url":"https://github.com/Qualtrax/QualtraxCloud","homepage":null,"size":262,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Qualtrax/QualtraxCloud/pulls/2"},"html":{"href":"https://github.com/Qualtrax/QualtraxCloud/pull/2"},"issue":{"href":"https://api.github.com/repos/Qualtrax/QualtraxCloud/issues/2"},"comments":{"href":"https://api.github.com/repos/Qualtrax/QualtraxCloud/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/Qualtrax/QualtraxCloud/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/Qualtrax/QualtraxCloud/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Qualtrax/QualtraxCloud/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/Qualtrax/QualtraxCloud/statuses/42d529f206f02fcba96bcef2d5b959b076eb908c"}}}}