{"action":"created","comment":{"url":"https://api.github.com/repos/telefonicaid/fiware-facts/pulls/comments/32073377","id":32073377,"diff_hunk":"@@ -0,0 +1,66 @@\n+#!/usr/bin/env python\n+# -*- encoding: utf-8 -*-\n+#\n+# Copyright 2014 Telefónica Investigación y Desarrollo, S.A.U\n+#\n+# This file is part of FI-WARE project.\n+#\n+# Licensed under the Apache License, Version 2.0 (the \"License\");\n+# you may not use this file except in compliance with the License.\n+#\n+# You may obtain a copy of the License at:\n+#\n+#        http://www.apache.org/licenses/LICENSE-2.0\n+#\n+# Unless required by applicable law or agreed to in writing, software\n+# distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+#\n+# See the License for the specific language governing permissions and\n+# limitations under the License.\n+#\n+# For those usages not covered by the Apache version 2.0 License please\n+# contact with opensource@tid.es\n+#\n+__author__ = 'gjp'\n+import logging.config\n+from config import config\n+import MySQLdb as mysql\n+from keystoneclient.exceptions import NotFound\n+\n+\n+class cloto_db_client():\n+    \"\"\"This class provides methods to provide connection with Cloto database.\n+    \"\"\"\n+    conn = None\n+\n+    def get_window_size(self, tenantId):\n+        \"\"\"\n+        This method is in charge of retrieve the window size of a tenantId from cloto database.\n+\n+        :param tenantId: the id of the tenant to request the windowsize\n+        :return: the window size\n+        \"\"\"\n+        try:\n+            if self.conn == None:\n+                self.conn = mysql.connect(charset=config.get('mysql', 'charset'), use_unicode=True,\n+                                     host=config.get('mysql', 'host'),\n+                                     user=config.get('mysql', 'user'), passwd=config.get('mysql', 'password'),\n+                                     db=config.get('mysql', 'db'))\n+            cursor = self.conn.cursor()\n+            cursor.execute('SELECT * FROM cloto.cloto_tenantinfo WHERE tenantId=\"%s\"' % tenantId)","path":"facts/cloto_db_client.py","position":51,"original_position":51,"commit_id":"bd4582b5091e68187f34e2e1ccc9f1c4c9ae8b29","original_commit_id":"bd4582b5091e68187f34e2e1ccc9f1c4c9ae8b29","user":{"login":"flopezag","id":1379796,"avatar_url":"https://avatars.githubusercontent.com/u/1379796?v=3","gravatar_id":"","url":"https://api.github.com/users/flopezag","html_url":"https://github.com/flopezag","followers_url":"https://api.github.com/users/flopezag/followers","following_url":"https://api.github.com/users/flopezag/following{/other_user}","gists_url":"https://api.github.com/users/flopezag/gists{/gist_id}","starred_url":"https://api.github.com/users/flopezag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flopezag/subscriptions","organizations_url":"https://api.github.com/users/flopezag/orgs","repos_url":"https://api.github.com/users/flopezag/repos","events_url":"https://api.github.com/users/flopezag/events{/privacy}","received_events_url":"https://api.github.com/users/flopezag/received_events","type":"User","site_admin":false},"body":"NTC","created_at":"2015-06-09T22:49:53Z","updated_at":"2015-06-09T22:49:53Z","html_url":"https://github.com/telefonicaid/fiware-facts/pull/21#discussion_r32073377","pull_request_url":"https://api.github.com/repos/telefonicaid/fiware-facts/pulls/21","_links":{"self":{"href":"https://api.github.com/repos/telefonicaid/fiware-facts/pulls/comments/32073377"},"html":{"href":"https://github.com/telefonicaid/fiware-facts/pull/21#discussion_r32073377"},"pull_request":{"href":"https://api.github.com/repos/telefonicaid/fiware-facts/pulls/21"}}},"pull_request":{"url":"https://api.github.com/repos/telefonicaid/fiware-facts/pulls/21","id":37246567,"html_url":"https://github.com/telefonicaid/fiware-facts/pull/21","diff_url":"https://github.com/telefonicaid/fiware-facts/pull/21.diff","patch_url":"https://github.com/telefonicaid/fiware-facts/pull/21.patch","issue_url":"https://api.github.com/repos/telefonicaid/fiware-facts/issues/21","number":21,"state":"open","locked":false,"title":"Bug/claudia 5154","user":{"login":"geonexus","id":7373366,"avatar_url":"https://avatars.githubusercontent.com/u/7373366?v=3","gravatar_id":"","url":"https://api.github.com/users/geonexus","html_url":"https://github.com/geonexus","followers_url":"https://api.github.com/users/geonexus/followers","following_url":"https://api.github.com/users/geonexus/following{/other_user}","gists_url":"https://api.github.com/users/geonexus/gists{/gist_id}","starred_url":"https://api.github.com/users/geonexus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geonexus/subscriptions","organizations_url":"https://api.github.com/users/geonexus/orgs","repos_url":"https://api.github.com/users/geonexus/repos","events_url":"https://api.github.com/users/geonexus/events{/privacy}","received_events_url":"https://api.github.com/users/geonexus/received_events","type":"User","site_admin":false},"body":"### REVIEWERS\r\n@flopezag @jframos \r\n\r\n### DESCRIPTION\r\nWindowsize is now taken from cloto database\r\nchecking that connection to rabbitMQ is open before close it\r\nFixing some bugs in the windowsize representation\r\n","created_at":"2015-06-09T12:14:12Z","updated_at":"2015-06-09T22:49:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8dd1e553a81a04315f1a8cc9576a58c34240e495","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/telefonicaid/fiware-facts/pulls/21/commits","review_comments_url":"https://api.github.com/repos/telefonicaid/fiware-facts/pulls/21/comments","review_comment_url":"https://api.github.com/repos/telefonicaid/fiware-facts/pulls/comments{/number}","comments_url":"https://api.github.com/repos/telefonicaid/fiware-facts/issues/21/comments","statuses_url":"https://api.github.com/repos/telefonicaid/fiware-facts/statuses/bd4582b5091e68187f34e2e1ccc9f1c4c9ae8b29","head":{"label":"telefonicaid:Bug/CLAUDIA-5154","ref":"Bug/CLAUDIA-5154","sha":"bd4582b5091e68187f34e2e1ccc9f1c4c9ae8b29","user":{"login":"telefonicaid","id":968363,"avatar_url":"https://avatars.githubusercontent.com/u/968363?v=3","gravatar_id":"","url":"https://api.github.com/users/telefonicaid","html_url":"https://github.com/telefonicaid","followers_url":"https://api.github.com/users/telefonicaid/followers","following_url":"https://api.github.com/users/telefonicaid/following{/other_user}","gists_url":"https://api.github.com/users/telefonicaid/gists{/gist_id}","starred_url":"https://api.github.com/users/telefonicaid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/telefonicaid/subscriptions","organizations_url":"https://api.github.com/users/telefonicaid/orgs","repos_url":"https://api.github.com/users/telefonicaid/repos","events_url":"https://api.github.com/users/telefonicaid/events{/privacy}","received_events_url":"https://api.github.com/users/telefonicaid/received_events","type":"Organization","site_admin":false},"repo":{"id":18985918,"name":"fiware-facts","full_name":"telefonicaid/fiware-facts","owner":{"login":"telefonicaid","id":968363,"avatar_url":"https://avatars.githubusercontent.com/u/968363?v=3","gravatar_id":"","url":"https://api.github.com/users/telefonicaid","html_url":"https://github.com/telefonicaid","followers_url":"https://api.github.com/users/telefonicaid/followers","following_url":"https://api.github.com/users/telefonicaid/following{/other_user}","gists_url":"https://api.github.com/users/telefonicaid/gists{/gist_id}","starred_url":"https://api.github.com/users/telefonicaid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/telefonicaid/subscriptions","organizations_url":"https://api.github.com/users/telefonicaid/orgs","repos_url":"https://api.github.com/users/telefonicaid/repos","events_url":"https://api.github.com/users/telefonicaid/events{/privacy}","received_events_url":"https://api.github.com/users/telefonicaid/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/telefonicaid/fiware-facts","description":"","fork":false,"url":"https://api.github.com/repos/telefonicaid/fiware-facts","forks_url":"https://api.github.com/repos/telefonicaid/fiware-facts/forks","keys_url":"https://api.github.com/repos/telefonicaid/fiware-facts/keys{/key_id}","collaborators_url":"https://api.github.com/repos/telefonicaid/fiware-facts/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/telefonicaid/fiware-facts/teams","hooks_url":"https://api.github.com/repos/telefonicaid/fiware-facts/hooks","issue_events_url":"https://api.github.com/repos/telefonicaid/fiware-facts/issues/events{/number}","events_url":"https://api.github.com/repos/telefonicaid/fiware-facts/events","assignees_url":"https://api.github.com/repos/telefonicaid/fiware-facts/assignees{/user}","branches_url":"https://api.github.com/repos/telefonicaid/fiware-facts/branches{/branch}","tags_url":"https://api.github.com/repos/telefonicaid/fiware-facts/tags","blobs_url":"https://api.github.com/repos/telefonicaid/fiware-facts/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/telefonicaid/fiware-facts/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/telefonicaid/fiware-facts/git/refs{/sha}","trees_url":"https://api.github.com/repos/telefonicaid/fiware-facts/git/trees{/sha}","statuses_url":"https://api.github.com/repos/telefonicaid/fiware-facts/statuses/{sha}","languages_url":"https://api.github.com/repos/telefonicaid/fiware-facts/languages","stargazers_url":"https://api.github.com/repos/telefonicaid/fiware-facts/stargazers","contributors_url":"https://api.github.com/repos/telefonicaid/fiware-facts/contributors","subscribers_url":"https://api.github.com/repos/telefonicaid/fiware-facts/subscribers","subscription_url":"https://api.github.com/repos/telefonicaid/fiware-facts/subscription","commits_url":"https://api.github.com/repos/telefonicaid/fiware-facts/commits{/sha}","git_commits_url":"https://api.github.com/repos/telefonicaid/fiware-facts/git/commits{/sha}","comments_url":"https://api.github.com/repos/telefonicaid/fiware-facts/comments{/number}","issue_comment_url":"https://api.github.com/repos/telefonicaid/fiware-facts/issues/comments{/number}","contents_url":"https://api.github.com/repos/telefonicaid/fiware-facts/contents/{+path}","compare_url":"https://api.github.com/repos/telefonicaid/fiware-facts/compare/{base}...{head}","merges_url":"https://api.github.com/repos/telefonicaid/fiware-facts/merges","archive_url":"https://api.github.com/repos/telefonicaid/fiware-facts/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/telefonicaid/fiware-facts/downloads","issues_url":"https://api.github.com/repos/telefonicaid/fiware-facts/issues{/number}","pulls_url":"https://api.github.com/repos/telefonicaid/fiware-facts/pulls{/number}","milestones_url":"https://api.github.com/repos/telefonicaid/fiware-facts/milestones{/number}","notifications_url":"https://api.github.com/repos/telefonicaid/fiware-facts/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/telefonicaid/fiware-facts/labels{/name}","releases_url":"https://api.github.com/repos/telefonicaid/fiware-facts/releases{/id}","created_at":"2014-04-21T07:44:18Z","updated_at":"2015-04-14T10:05:50Z","pushed_at":"2015-06-09T12:14:12Z","git_url":"git://github.com/telefonicaid/fiware-facts.git","ssh_url":"git@github.com:telefonicaid/fiware-facts.git","clone_url":"https://github.com/telefonicaid/fiware-facts.git","svn_url":"https://github.com/telefonicaid/fiware-facts","homepage":null,"size":660,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":1,"forks":2,"open_issues":1,"watchers":0,"default_branch":"develop"}},"base":{"label":"telefonicaid:develop","ref":"develop","sha":"7c4b31cf05b5dbe40a812098448eff9fabadde6b","user":{"login":"telefonicaid","id":968363,"avatar_url":"https://avatars.githubusercontent.com/u/968363?v=3","gravatar_id":"","url":"https://api.github.com/users/telefonicaid","html_url":"https://github.com/telefonicaid","followers_url":"https://api.github.com/users/telefonicaid/followers","following_url":"https://api.github.com/users/telefonicaid/following{/other_user}","gists_url":"https://api.github.com/users/telefonicaid/gists{/gist_id}","starred_url":"https://api.github.com/users/telefonicaid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/telefonicaid/subscriptions","organizations_url":"https://api.github.com/users/telefonicaid/orgs","repos_url":"https://api.github.com/users/telefonicaid/repos","events_url":"https://api.github.com/users/telefonicaid/events{/privacy}","received_events_url":"https://api.github.com/users/telefonicaid/received_events","type":"Organization","site_admin":false},"repo":{"id":18985918,"name":"fiware-facts","full_name":"telefonicaid/fiware-facts","owner":{"login":"telefonicaid","id":968363,"avatar_url":"https://avatars.githubusercontent.com/u/968363?v=3","gravatar_id":"","url":"https://api.github.com/users/telefonicaid","html_url":"https://github.com/telefonicaid","followers_url":"https://api.github.com/users/telefonicaid/followers","following_url":"https://api.github.com/users/telefonicaid/following{/other_user}","gists_url":"https://api.github.com/users/telefonicaid/gists{/gist_id}","starred_url":"https://api.github.com/users/telefonicaid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/telefonicaid/subscriptions","organizations_url":"https://api.github.com/users/telefonicaid/orgs","repos_url":"https://api.github.com/users/telefonicaid/repos","events_url":"https://api.github.com/users/telefonicaid/events{/privacy}","received_events_url":"https://api.github.com/users/telefonicaid/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/telefonicaid/fiware-facts","description":"","fork":false,"url":"https://api.github.com/repos/telefonicaid/fiware-facts","forks_url":"https://api.github.com/repos/telefonicaid/fiware-facts/forks","keys_url":"https://api.github.com/repos/telefonicaid/fiware-facts/keys{/key_id}","collaborators_url":"https://api.github.com/repos/telefonicaid/fiware-facts/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/telefonicaid/fiware-facts/teams","hooks_url":"https://api.github.com/repos/telefonicaid/fiware-facts/hooks","issue_events_url":"https://api.github.com/repos/telefonicaid/fiware-facts/issues/events{/number}","events_url":"https://api.github.com/repos/telefonicaid/fiware-facts/events","assignees_url":"https://api.github.com/repos/telefonicaid/fiware-facts/assignees{/user}","branches_url":"https://api.github.com/repos/telefonicaid/fiware-facts/branches{/branch}","tags_url":"https://api.github.com/repos/telefonicaid/fiware-facts/tags","blobs_url":"https://api.github.com/repos/telefonicaid/fiware-facts/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/telefonicaid/fiware-facts/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/telefonicaid/fiware-facts/git/refs{/sha}","trees_url":"https://api.github.com/repos/telefonicaid/fiware-facts/git/trees{/sha}","statuses_url":"https://api.github.com/repos/telefonicaid/fiware-facts/statuses/{sha}","languages_url":"https://api.github.com/repos/telefonicaid/fiware-facts/languages","stargazers_url":"https://api.github.com/repos/telefonicaid/fiware-facts/stargazers","contributors_url":"https://api.github.com/repos/telefonicaid/fiware-facts/contributors","subscribers_url":"https://api.github.com/repos/telefonicaid/fiware-facts/subscribers","subscription_url":"https://api.github.com/repos/telefonicaid/fiware-facts/subscription","commits_url":"https://api.github.com/repos/telefonicaid/fiware-facts/commits{/sha}","git_commits_url":"https://api.github.com/repos/telefonicaid/fiware-facts/git/commits{/sha}","comments_url":"https://api.github.com/repos/telefonicaid/fiware-facts/comments{/number}","issue_comment_url":"https://api.github.com/repos/telefonicaid/fiware-facts/issues/comments{/number}","contents_url":"https://api.github.com/repos/telefonicaid/fiware-facts/contents/{+path}","compare_url":"https://api.github.com/repos/telefonicaid/fiware-facts/compare/{base}...{head}","merges_url":"https://api.github.com/repos/telefonicaid/fiware-facts/merges","archive_url":"https://api.github.com/repos/telefonicaid/fiware-facts/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/telefonicaid/fiware-facts/downloads","issues_url":"https://api.github.com/repos/telefonicaid/fiware-facts/issues{/number}","pulls_url":"https://api.github.com/repos/telefonicaid/fiware-facts/pulls{/number}","milestones_url":"https://api.github.com/repos/telefonicaid/fiware-facts/milestones{/number}","notifications_url":"https://api.github.com/repos/telefonicaid/fiware-facts/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/telefonicaid/fiware-facts/labels{/name}","releases_url":"https://api.github.com/repos/telefonicaid/fiware-facts/releases{/id}","created_at":"2014-04-21T07:44:18Z","updated_at":"2015-04-14T10:05:50Z","pushed_at":"2015-06-09T12:14:12Z","git_url":"git://github.com/telefonicaid/fiware-facts.git","ssh_url":"git@github.com:telefonicaid/fiware-facts.git","clone_url":"https://github.com/telefonicaid/fiware-facts.git","svn_url":"https://github.com/telefonicaid/fiware-facts","homepage":null,"size":660,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":1,"forks":2,"open_issues":1,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/telefonicaid/fiware-facts/pulls/21"},"html":{"href":"https://github.com/telefonicaid/fiware-facts/pull/21"},"issue":{"href":"https://api.github.com/repos/telefonicaid/fiware-facts/issues/21"},"comments":{"href":"https://api.github.com/repos/telefonicaid/fiware-facts/issues/21/comments"},"review_comments":{"href":"https://api.github.com/repos/telefonicaid/fiware-facts/pulls/21/comments"},"review_comment":{"href":"https://api.github.com/repos/telefonicaid/fiware-facts/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/telefonicaid/fiware-facts/pulls/21/commits"},"statuses":{"href":"https://api.github.com/repos/telefonicaid/fiware-facts/statuses/bd4582b5091e68187f34e2e1ccc9f1c4c9ae8b29"}}}}