fedora-infra / fedmsg_meta_fedora_infrastructure

fedmsg metadata providers for Fedora Infrastructure's deployment
GNU Lesser General Public License v2.1
15 stars 47 forks source link

GitHub: UnboundLocalError: local variable 'tmpl' referenced before assignment #474

Open jeremycline opened 6 years ago

jeremycline commented 6 years ago

From the FMN logs:

Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/fmn/formatters.py", line 406, in email
    content += fedmsg.meta.msg2long_form(message, **config.app_conf) or u''
  File "/usr/lib/python2.7/site-packages/fedmsg/meta/__init__.py", line 152, in __wrapper
    return f(msg, **config)
  File "/usr/lib/python2.7/site-packages/fedmsg/meta/__init__.py", line 171, in __wrapper
    return f(msg, processor=processor, **config)
  File "/usr/lib/python2.7/site-packages/fedmsg/meta/__init__.py", line 259, in msg2long_form
    result = processor.subtitle(msg, **config)
  File "/usr/lib/python2.7/site-packages/fedmsg_meta_fedora_infrastructure/github.py", line 197, in subtitle
    return tmpl.format(user=user, n=n, repo=repo, state=state)
UnboundLocalError: local variable 'tmpl' referenced before assignment

from the message

{u'username': u'apache',u'i': 31, u'timestamp': 1523373430, u'msg_id': u'2018-a3edb987-8e78-4629-81df-ef5a741478fd', u'crypto': u'x509', u'topic': u'org.fedoraproject.prod.github.pull_request_review', u'msg': {u'sender': {u'url': u'https://api.github.com/users/leseb', u'site_admin': False, u'html_url': u'https://github.com/leseb', u'gravatar_id': u'', u'login': u'leseb', u'type': u'User', u'id': 912735}, u'repository': {u'has_wiki': False, u'forks_count': 428, u'updated_at': u'2018-04-10T12:19:32Z', u'private': False, u'full_name': u'
 ceph/ceph-ansible', u'owner': {u'url': u'https://api.github.com/users/ceph', u'site_admin': False, u'html_url': u'https://github.com/ceph', u'gravatar_id': u'', u'login': u'ceph', u'type': u'Organization', u'id': 1015767}, u'id': 17373313, u'size': 4525, u'license': {u'spdx_id': u'Apache-2.0', u'url': u'https://api.github.com/licenses/apache-2.0', u'name': u'Apache License 2.0', u'key': u'apache-2.0'}, u'archived': False, u'has_projects': True, u'watchers_count': 594, u'stargazers_count': 594, u'homepage': None, u'fork': False, u'description': u'Ansible playbooks for Ceph', u'has_downloads': True, u'has_pages': False, u'default_branch': u'master', u'html_url': u'https://github.com/ceph/ceph-ansible', u'has_issues': True, u'forks': 428, u'open_issues_count': 151, u'watchers': 594, u'name': u'ceph-ansible', u'language': u'Python', u'url': u'https://api.github.com/repos/ceph/ceph-ansible', u'created_at': u'2014-03-03T17:12:09Z', u'pushed_at': u'2018-04-10T15:17:08Z', u'open_issues': 15
 1}, u'review': {u'body': u'', u'commit_id': u'e1fa5de43b427f76c990828d345133fb7601531c', u'submitted_at': u'2018-04-10T12:37:49Z', u'author_association': u'CONTRIBUTOR', u'html_url': u'https://github.com/ceph/ceph-ansible/pull/2505#pullrequestreview-110815566', u'state': u'dismissed', u'user': {u'url': u'https://api.github.com/users/leseb', u'site_admin': False, u'html_url': u'https://github.com/leseb', u'gravatar_id': u'', u'login': u'leseb', u'type': u'User', u'id': 912735}, u'id': 110815566}, u'fas_usernames': {u'ceph': u'github_org_ceph'}, u'pull_request': {u'merge_commit_sha': u'2f440a135da523baf9e91fce8053d84fe8532be4', u'labels': [], u'number': 2505, u'assignee': None, u'closed_at': None, u'requested_reviewers': [], u'id': 180356951, u'title': u'[skip ci] defaults: check only 1 time if there is a running cluster', u'merged_at': None, u'state': u'open', u'body': u"There is no need to check for a running cluster n*nodes time in\r\n`ceph-defaults` so let's add a `run_once: true`
  to save some resources\r\nand time.\r\n\r\nSigned-off-by: Guillaume Abrioux <gabrioux@redhat.com>", u'head': {u'repo': {u'has_wiki': False, u'forks_count': 428, u'updated_at': u'2018-04-10T12:19:32Z', u'private': False, u'full_name': u'ceph/ceph-ansible', u'owner': {u'url': u'https://api.github.com/users/ceph', u'site_admin': False, u'html_url': u'https://github.com/ceph', u'gravatar_id': u'', u'login': u'ceph', u'type': u'Organization', u'id': 1015767}, u'id': 17373313, u'size': 4525, u'license': {u'spdx_id': u'Apache-2.0', u'url': u'https://api.github.com/licenses/apache-2.0', u'name': u'Apache License 2.0', u'key': u'apache-2.0'}, u'archived': False, u'has_projects': True, u'watchers_count': 594, u'stargazers_count': 594, u'homepage': None, u'fork': False, u'description': u'Ansible playbooks for Ceph', u'has_downloads': True, u'has_pages': False, u'default_branch': u'master', u'html_url': u'https://github.com/ceph/ceph-ansible', u'has_issues': True, u'forks': 428, u'open_issues_
 count': 151, u'watchers': 594, u'name': u'ceph-ansible', u'language': u'Python', u'url': u'https://api.github.com/repos/ceph/ceph-ansible', u'created_at': u'2014-03-03T17:12:09Z', u'pushed_at': u'2018-04-10T15:17:08Z', u'open_issues': 151}, u'sha': u'ca73d6b11ed0e6056f2258153473bd19818364e8', u'ref': u'check_running_cluster_1_time', u'user': {u'url': u'https://api.github.com/users/ceph', u'site_admin': False, u'html_url': u'https://github.com/ceph', u'gravatar_id': u'', u'login': u'ceph', u'type': u'Organization', u'id': 1015767}, u'label': u'ceph:check_running_cluster_1_time'}, u'author_association': u'COLLABORATOR', u'html_url': u'https://github.com/ceph/ceph-ansible/pull/2505', u'updated_at': u'2018-04-10T15:17:09Z', u'base': {u'repo': {u'has_wiki': False, u'forks_count': 428, u'updated_at': u'2018-04-10T12:19:32Z', u'private': False, u'full_name': u'ceph/ceph-ansible', u'owner': {u'url': u'https://api.github.com/users/ceph', u'site_admin': False, u'html_url': u'https://github.co
 m/ceph', u'gravatar_id': u'', u'login': u'ceph', u'type': u'Organization', u'id': 1015767}, u'id': 17373313, u'size': 4525, u'license': {u'spdx_id': u'Apache-2.0', u'url': u'https://api.github.com/licenses/apache-2.0', u'name': u'Apache License 2.0', u'key': u'apache-2.0'}, u'archived': False, u'has_projects': True, u'watchers_count': 594, u'stargazers_count': 594, u'homepage': None, u'fork': False, u'description': u'Ansible playbooks for Ceph', u'has_downloads': True, u'has_pages': False, u'default_branch': u'master', u'html_url': u'https://github.com/ceph/ceph-ansible', u'has_issues': True, u'forks': 428, u'open_issues_count': 151, u'watchers': 594, u'name': u'ceph-ansible', u'language': u'Python', u'url': u'https://api.github.com/repos/ceph/ceph-ansible', u'created_at': u'2014-03-03T17:12:09Z', u'pushed_at': u'2018-04-10T15:17:08Z', u'open_issues': 151}, u'sha': u'4a4fb1a4df73021f658415618244011f0cd1e780', u'ref': u'master', u'user': {u'url': u'https://api.github.com/users/ceph',
  u'site_admin': False, u'html_url': u'https://github.com/ceph', u'gravatar_id': u'', u'login': u'ceph', u'type': u'Organization', u'id': 1015767}, u'label': u'ceph:master'}, u'user': {u'url': u'https://api.github.com/users/guits', u'site_admin': False, u'html_url': u'https://github.com/guits', u'gravatar_id': u'', u'login': u'guits', u'type': u'User', u'id': 3717838}, u'milestone': {u'number': 1, u'description': u'', u'title': u'v3.1', u'url': u'https://api.github.com/repos/ceph/ceph-ansible/milestones/1', u'created_at': u'2017-10-11T14:02:03Z', u'creator': {u'url': u'https://api.github.com/users/leseb', u'site_admin': False, u'html_url': u'https://github.com/leseb', u'gravatar_id': u'', u'login': u'leseb', u'type': u'User', u'id': 912735}, u'updated_at': u'2018-04-10T13:42:06Z', u'html_url': u'https://github.com/ceph/ceph-ansible/milestone/1', u'due_on': None, u'state': u'open', u'closed_issues': 42, u'open_issues': 12, u'closed_at': None, u'id': 2830499}, u'requested_teams': [], u
 'locked': False, u'url': u'https://api.github.com/repos/ceph/ceph-ansible/pulls/2505', u'created_at': u'2018-04-09T16:09:51Z', u'assignees': []}, u'action': u'dismissed', u'organization': {u'url': u'https://api.github.com/orgs/ceph', u'login': u'ceph', u'description': None, u'id': 1015767}}}