From 8eaad691a774bf8b1f514135f55a85584a6b88cc Mon Sep 17 00:00:00 2001 From: Ken'ichi Ohmichi Date: Tue, 13 Jun 2017 13:54:10 -0700 Subject: [PATCH] Remove unused ldap_id ldap_id is not used at any places and default_data.json doesn't contain it for user information. So let's remove it for the cleanup. Change-Id: Ic4a27a6bd882ae6fd700a85c0661c2b2407bad88 --- .../dashboard/templates/_macros/user_profile.html | 3 --- stackalytics/processor/record_processor.py | 3 +-- stackalytics/processor/schema.py | 3 --- stackalytics/processor/user_processor.py | 12 ++---------- stackalytics/tests/unit/test_config_files.py | 3 +-- 5 files changed, 4 insertions(+), 20 deletions(-) diff --git a/stackalytics/dashboard/templates/_macros/user_profile.html b/stackalytics/dashboard/templates/_macros/user_profile.html index 79d838437..4fe37531d 100644 --- a/stackalytics/dashboard/templates/_macros/user_profile.html +++ b/stackalytics/dashboard/templates/_macros/user_profile.html @@ -41,9 +41,6 @@ {%if zanata_id %}
Zanata: ${zanata_id}
{%/if%} - {%if ldap_id %} -
LDAP: ${ldap_id}
- {%/if%} {%if core %}
Core in: {%each( index, value ) core %} diff --git a/stackalytics/processor/record_processor.py b/stackalytics/processor/record_processor.py index 0a03626bb..0288efd63 100644 --- a/stackalytics/processor/record_processor.py +++ b/stackalytics/processor/record_processor.py @@ -188,8 +188,7 @@ class RecordProcessor(object): # collect ordinary fields for key in ['seq', 'user_name', 'user_id', 'gerrit_id', 'github_id', - 'launchpad_id', 'companies', 'static', 'ldap_id', - 'zanata_id']: + 'launchpad_id', 'companies', 'static', 'zanata_id']: value = next((v.get(key) for v in user_profiles if v.get(key)), None) if value: diff --git a/stackalytics/processor/schema.py b/stackalytics/processor/schema.py index e45982cd7..2b1ea4659 100644 --- a/stackalytics/processor/schema.py +++ b/stackalytics/processor/schema.py @@ -33,9 +33,6 @@ default_data = { "gerrit_id": { "type": "string" }, - "ldap_id": { - "type": "string" - }, "zanata_id": { "type": "string" }, diff --git a/stackalytics/processor/user_processor.py b/stackalytics/processor/user_processor.py index 3ac59014e..21237685f 100644 --- a/stackalytics/processor/user_processor.py +++ b/stackalytics/processor/user_processor.py @@ -22,8 +22,7 @@ LOG = logging.getLogger(__name__) def make_user_id(emails=None, launchpad_id=None, gerrit_id=None, - member_id=None, github_id=None, ldap_id=None, ci_id=None, - zanata_id=None): + member_id=None, github_id=None, ci_id=None, zanata_id=None): if launchpad_id or emails: return launchpad_id or emails[0] if gerrit_id: @@ -32,8 +31,6 @@ def make_user_id(emails=None, launchpad_id=None, gerrit_id=None, return 'member:%s' % member_id if github_id: return 'github:%s' % github_id - if ldap_id: - return 'ldap:%s' % ldap_id if zanata_id: return 'zanata:%s' % zanata_id if ci_id: @@ -56,9 +53,6 @@ def store_user(runtime_storage_inst, user): if user.get('github_id'): runtime_storage_inst.set_by_key('user:github:%s' % user['github_id'], user) - if user.get('ldap_id'): - runtime_storage_inst.set_by_key('user:ldap:%s' % user['ldap_id'], - user) if user.get('zanata_id'): runtime_storage_inst.set_by_key('user:zanata:%s' % user['zanata_id'], user) @@ -68,15 +62,13 @@ def store_user(runtime_storage_inst, user): def load_user(runtime_storage_inst, seq=None, user_id=None, email=None, launchpad_id=None, gerrit_id=None, member_id=None, - github_id=None, ldap_id=None, zanata_id=None): + github_id=None, zanata_id=None): if gerrit_id: key = 'gerrit:%s' % gerrit_id elif member_id: key = 'member:%s' % member_id elif github_id: key = 'github:%s' % github_id - elif ldap_id: - key = 'ldap:%s' % ldap_id elif zanata_id: key = 'zanata:%s' % zanata_id else: diff --git a/stackalytics/tests/unit/test_config_files.py b/stackalytics/tests/unit/test_config_files.py index 6395071b0..ae9ac8278 100644 --- a/stackalytics/tests/unit/test_config_files.py +++ b/stackalytics/tests/unit/test_config_files.py @@ -125,8 +125,7 @@ class TestConfigFiles(testtools.TestCase): def _verify_users_in_alphabetical_order(self, file_name): users = self._read_file(file_name)['users'] self._verify_ordering( - users, key=lambda x: (x.get('launchpad_id') or x.get('ldap_id') or - x.get('github_id')), + users, key=lambda x: (x.get('launchpad_id') or x.get('github_id')), msg='List of users should be ordered by launchpad id or ldap id ' 'or github id')