{"action":"created","comment":{"url":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/pulls/comments/189501411","pull_request_review_id":121691243,"id":189501411,"diff_hunk":"@@ -0,0 +1,392 @@\n+﻿import paramiko\n+from paramiko import ssh_exception\n+import sys\n+import getpass\n+import importlib\n+import wmi\n+import pymysql\n+from pymysql import MySQLError\n+from pysnmp.hlapi import *\n+\n+sys.path.append(r'C:\\Users\\%s\\PycharmProjects\\Positive\\Positive-Technologies\\scripts' % getpass.getuser())\n+imported_config = importlib.import_module('get_config')\n+\n+\n+class TransportSSH:\n+    def __init__(self):\n+        self.statuses = {1: 'STATUS_COMPLIANT', 2: 'STATUS_NOT_COMPLIANT', 3: 'STATUS_NOT_APPLICABLE', 4: 'STATUS_ERROR',\n+                         5: 'STATUS_EXCEPTION'}\n+        self.client = None\n+\n+    def get_transport(self, host=imported_config.config()['host'],\n+                      login=imported_config.config()['transports']['SSH']['login'],\n+                      password=imported_config.config()['transports']['SSH']['password'],\n+                      port=imported_config.config()['transports']['SSH']['port']):\n+        self.client = paramiko.SSHClient()\n+        self.client.set_missing_host_key_policy(paramiko.AutoAddPolicy())\n+        try:\n+            transport = self.client.connect(hostname=host, username=login, password=password, port=port)\n+            return transport\n+        #  except ssh_exception.NoValidConnectionsError:\n+        except:\n+            print('ConnectionError')\n+            return self.statuses[5]\n+\n+    def execution_command(self, command):\n+        stdin, stdout, stderr = self.client.exec_command(command)\n+        result = []\n+        if stderr.readlines():\n+            stdin, stdout, stderr = self.client.exec_command(command)","path":"scripts/Script001.py","position":39,"original_position":39,"commit_id":"3aeac572c1504d4c625281ef41bcfec31d9acec2","original_commit_id":"3aeac572c1504d4c625281ef41bcfec31d9acec2","user":{"login":"AnatolyFeteleu","id":19871844,"avatar_url":"https://avatars0.githubusercontent.com/u/19871844?v=4","gravatar_id":"","url":"https://api.github.com/users/AnatolyFeteleu","html_url":"https://github.com/AnatolyFeteleu","followers_url":"https://api.github.com/users/AnatolyFeteleu/followers","following_url":"https://api.github.com/users/AnatolyFeteleu/following{/other_user}","gists_url":"https://api.github.com/users/AnatolyFeteleu/gists{/gist_id}","starred_url":"https://api.github.com/users/AnatolyFeteleu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AnatolyFeteleu/subscriptions","organizations_url":"https://api.github.com/users/AnatolyFeteleu/orgs","repos_url":"https://api.github.com/users/AnatolyFeteleu/repos","events_url":"https://api.github.com/users/AnatolyFeteleu/events{/privacy}","received_events_url":"https://api.github.com/users/AnatolyFeteleu/received_events","type":"User","site_admin":false},"body":"Я хотел зафиксировать ошибку, которая была выведена после выполнения команды.","created_at":"2018-05-21T06:07:28Z","updated_at":"2018-05-21T06:07:28Z","html_url":"https://github.com/AnatolyFeteleu/Positive-Technologies/pull/1#discussion_r189501411","pull_request_url":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/pulls/1","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/pulls/comments/189501411"},"html":{"href":"https://github.com/AnatolyFeteleu/Positive-Technologies/pull/1#discussion_r189501411"},"pull_request":{"href":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/pulls/1"}},"in_reply_to_id":189469286},"pull_request":{"url":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/pulls/1","id":185930496,"html_url":"https://github.com/AnatolyFeteleu/Positive-Technologies/pull/1","diff_url":"https://github.com/AnatolyFeteleu/Positive-Technologies/pull/1.diff","patch_url":"https://github.com/AnatolyFeteleu/Positive-Technologies/pull/1.patch","issue_url":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/issues/1","number":1,"state":"open","locked":false,"title":"Develop","user":{"login":"AnatolyFeteleu","id":19871844,"avatar_url":"https://avatars0.githubusercontent.com/u/19871844?v=4","gravatar_id":"","url":"https://api.github.com/users/AnatolyFeteleu","html_url":"https://github.com/AnatolyFeteleu","followers_url":"https://api.github.com/users/AnatolyFeteleu/followers","following_url":"https://api.github.com/users/AnatolyFeteleu/following{/other_user}","gists_url":"https://api.github.com/users/AnatolyFeteleu/gists{/gist_id}","starred_url":"https://api.github.com/users/AnatolyFeteleu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AnatolyFeteleu/subscriptions","organizations_url":"https://api.github.com/users/AnatolyFeteleu/orgs","repos_url":"https://api.github.com/users/AnatolyFeteleu/repos","events_url":"https://api.github.com/users/AnatolyFeteleu/events{/privacy}","received_events_url":"https://api.github.com/users/AnatolyFeteleu/received_events","type":"User","site_admin":false},"body":"Здравствуйте, с каждой новой строчкой кода, начинаю постепенно запутываться, не могли бы вы посмотреть всё ли делаю верно и наставить на путь истинный 🌝 ","created_at":"2018-05-04T09:20:51Z","updated_at":"2018-05-21T06:07:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"83c87c4ee93c4a282cbbd2d933317a74befbf913","assignee":{"login":"AnatolyFeteleu","id":19871844,"avatar_url":"https://avatars0.githubusercontent.com/u/19871844?v=4","gravatar_id":"","url":"https://api.github.com/users/AnatolyFeteleu","html_url":"https://github.com/AnatolyFeteleu","followers_url":"https://api.github.com/users/AnatolyFeteleu/followers","following_url":"https://api.github.com/users/AnatolyFeteleu/following{/other_user}","gists_url":"https://api.github.com/users/AnatolyFeteleu/gists{/gist_id}","starred_url":"https://api.github.com/users/AnatolyFeteleu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AnatolyFeteleu/subscriptions","organizations_url":"https://api.github.com/users/AnatolyFeteleu/orgs","repos_url":"https://api.github.com/users/AnatolyFeteleu/repos","events_url":"https://api.github.com/users/AnatolyFeteleu/events{/privacy}","received_events_url":"https://api.github.com/users/AnatolyFeteleu/received_events","type":"User","site_admin":false},"assignees":[{"login":"AnatolyFeteleu","id":19871844,"avatar_url":"https://avatars0.githubusercontent.com/u/19871844?v=4","gravatar_id":"","url":"https://api.github.com/users/AnatolyFeteleu","html_url":"https://github.com/AnatolyFeteleu","followers_url":"https://api.github.com/users/AnatolyFeteleu/followers","following_url":"https://api.github.com/users/AnatolyFeteleu/following{/other_user}","gists_url":"https://api.github.com/users/AnatolyFeteleu/gists{/gist_id}","starred_url":"https://api.github.com/users/AnatolyFeteleu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AnatolyFeteleu/subscriptions","organizations_url":"https://api.github.com/users/AnatolyFeteleu/orgs","repos_url":"https://api.github.com/users/AnatolyFeteleu/repos","events_url":"https://api.github.com/users/AnatolyFeteleu/events{/privacy}","received_events_url":"https://api.github.com/users/AnatolyFeteleu/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/pulls/1/commits","review_comments_url":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/pulls/1/comments","review_comment_url":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/pulls/comments{/number}","comments_url":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/issues/1/comments","statuses_url":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/statuses/3aeac572c1504d4c625281ef41bcfec31d9acec2","head":{"label":"AnatolyFeteleu:develop","ref":"develop","sha":"3aeac572c1504d4c625281ef41bcfec31d9acec2","user":{"login":"AnatolyFeteleu","id":19871844,"avatar_url":"https://avatars0.githubusercontent.com/u/19871844?v=4","gravatar_id":"","url":"https://api.github.com/users/AnatolyFeteleu","html_url":"https://github.com/AnatolyFeteleu","followers_url":"https://api.github.com/users/AnatolyFeteleu/followers","following_url":"https://api.github.com/users/AnatolyFeteleu/following{/other_user}","gists_url":"https://api.github.com/users/AnatolyFeteleu/gists{/gist_id}","starred_url":"https://api.github.com/users/AnatolyFeteleu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AnatolyFeteleu/subscriptions","organizations_url":"https://api.github.com/users/AnatolyFeteleu/orgs","repos_url":"https://api.github.com/users/AnatolyFeteleu/repos","events_url":"https://api.github.com/users/AnatolyFeteleu/events{/privacy}","received_events_url":"https://api.github.com/users/AnatolyFeteleu/received_events","type":"User","site_admin":false},"repo":{"id":132115576,"name":"Positive-Technologies","full_name":"AnatolyFeteleu/Positive-Technologies","owner":{"login":"AnatolyFeteleu","id":19871844,"avatar_url":"https://avatars0.githubusercontent.com/u/19871844?v=4","gravatar_id":"","url":"https://api.github.com/users/AnatolyFeteleu","html_url":"https://github.com/AnatolyFeteleu","followers_url":"https://api.github.com/users/AnatolyFeteleu/followers","following_url":"https://api.github.com/users/AnatolyFeteleu/following{/other_user}","gists_url":"https://api.github.com/users/AnatolyFeteleu/gists{/gist_id}","starred_url":"https://api.github.com/users/AnatolyFeteleu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AnatolyFeteleu/subscriptions","organizations_url":"https://api.github.com/users/AnatolyFeteleu/orgs","repos_url":"https://api.github.com/users/AnatolyFeteleu/repos","events_url":"https://api.github.com/users/AnatolyFeteleu/events{/privacy}","received_events_url":"https://api.github.com/users/AnatolyFeteleu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/AnatolyFeteleu/Positive-Technologies","description":null,"fork":false,"url":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies","forks_url":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/forks","keys_url":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/teams","hooks_url":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/hooks","issue_events_url":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/issues/events{/number}","events_url":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/events","assignees_url":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/assignees{/user}","branches_url":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/branches{/branch}","tags_url":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/tags","blobs_url":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/git/refs{/sha}","trees_url":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/statuses/{sha}","languages_url":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/languages","stargazers_url":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/stargazers","contributors_url":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/contributors","subscribers_url":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/subscribers","subscription_url":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/subscription","commits_url":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/commits{/sha}","git_commits_url":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/git/commits{/sha}","comments_url":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/comments{/number}","issue_comment_url":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/issues/comments{/number}","contents_url":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/contents/{+path}","compare_url":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/merges","archive_url":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/downloads","issues_url":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/issues{/number}","pulls_url":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/pulls{/number}","milestones_url":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/milestones{/number}","notifications_url":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/labels{/name}","releases_url":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/releases{/id}","deployments_url":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/deployments","created_at":"2018-05-04T08:58:56Z","updated_at":"2018-05-04T08:58:59Z","pushed_at":"2018-05-20T15:49:42Z","git_url":"git://github.com/AnatolyFeteleu/Positive-Technologies.git","ssh_url":"git@github.com:AnatolyFeteleu/Positive-Technologies.git","clone_url":"https://github.com/AnatolyFeteleu/Positive-Technologies.git","svn_url":"https://github.com/AnatolyFeteleu/Positive-Technologies","homepage":null,"size":78,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"AnatolyFeteleu:master","ref":"master","sha":"99eb8bc41025b96f2a40927b3c102a3a71868e78","user":{"login":"AnatolyFeteleu","id":19871844,"avatar_url":"https://avatars0.githubusercontent.com/u/19871844?v=4","gravatar_id":"","url":"https://api.github.com/users/AnatolyFeteleu","html_url":"https://github.com/AnatolyFeteleu","followers_url":"https://api.github.com/users/AnatolyFeteleu/followers","following_url":"https://api.github.com/users/AnatolyFeteleu/following{/other_user}","gists_url":"https://api.github.com/users/AnatolyFeteleu/gists{/gist_id}","starred_url":"https://api.github.com/users/AnatolyFeteleu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AnatolyFeteleu/subscriptions","organizations_url":"https://api.github.com/users/AnatolyFeteleu/orgs","repos_url":"https://api.github.com/users/AnatolyFeteleu/repos","events_url":"https://api.github.com/users/AnatolyFeteleu/events{/privacy}","received_events_url":"https://api.github.com/users/AnatolyFeteleu/received_events","type":"User","site_admin":false},"repo":{"id":132115576,"name":"Positive-Technologies","full_name":"AnatolyFeteleu/Positive-Technologies","owner":{"login":"AnatolyFeteleu","id":19871844,"avatar_url":"https://avatars0.githubusercontent.com/u/19871844?v=4","gravatar_id":"","url":"https://api.github.com/users/AnatolyFeteleu","html_url":"https://github.com/AnatolyFeteleu","followers_url":"https://api.github.com/users/AnatolyFeteleu/followers","following_url":"https://api.github.com/users/AnatolyFeteleu/following{/other_user}","gists_url":"https://api.github.com/users/AnatolyFeteleu/gists{/gist_id}","starred_url":"https://api.github.com/users/AnatolyFeteleu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AnatolyFeteleu/subscriptions","organizations_url":"https://api.github.com/users/AnatolyFeteleu/orgs","repos_url":"https://api.github.com/users/AnatolyFeteleu/repos","events_url":"https://api.github.com/users/AnatolyFeteleu/events{/privacy}","received_events_url":"https://api.github.com/users/AnatolyFeteleu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/AnatolyFeteleu/Positive-Technologies","description":null,"fork":false,"url":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies","forks_url":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/forks","keys_url":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/teams","hooks_url":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/hooks","issue_events_url":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/issues/events{/number}","events_url":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/events","assignees_url":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/assignees{/user}","branches_url":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/branches{/branch}","tags_url":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/tags","blobs_url":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/git/refs{/sha}","trees_url":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/statuses/{sha}","languages_url":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/languages","stargazers_url":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/stargazers","contributors_url":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/contributors","subscribers_url":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/subscribers","subscription_url":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/subscription","commits_url":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/commits{/sha}","git_commits_url":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/git/commits{/sha}","comments_url":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/comments{/number}","issue_comment_url":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/issues/comments{/number}","contents_url":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/contents/{+path}","compare_url":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/merges","archive_url":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/downloads","issues_url":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/issues{/number}","pulls_url":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/pulls{/number}","milestones_url":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/milestones{/number}","notifications_url":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/labels{/name}","releases_url":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/releases{/id}","deployments_url":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/deployments","created_at":"2018-05-04T08:58:56Z","updated_at":"2018-05-04T08:58:59Z","pushed_at":"2018-05-20T15:49:42Z","git_url":"git://github.com/AnatolyFeteleu/Positive-Technologies.git","ssh_url":"git@github.com:AnatolyFeteleu/Positive-Technologies.git","clone_url":"https://github.com/AnatolyFeteleu/Positive-Technologies.git","svn_url":"https://github.com/AnatolyFeteleu/Positive-Technologies","homepage":null,"size":78,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/pulls/1"},"html":{"href":"https://github.com/AnatolyFeteleu/Positive-Technologies/pull/1"},"issue":{"href":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/issues/1"},"comments":{"href":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/AnatolyFeteleu/Positive-Technologies/statuses/3aeac572c1504d4c625281ef41bcfec31d9acec2"}},"author_association":"OWNER"}}
{"actor":{"display_login":"AnatolyFeteleu"}}