From 007df9f55ecb21afb1b00f605b1499c72ac8da1c Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Sep 23 2018 13:53:44 +0000 Subject: Clear out code that is no longer needed since we don't install hooks anymore Signed-off-by: Pierre-Yves Chibon --- diff --git a/pagure/hooks/default.py b/pagure/hooks/default.py index 3e5477b..94d8623 100644 --- a/pagure/hooks/default.py +++ b/pagure/hooks/default.py @@ -340,27 +340,3 @@ class Default(BaseHook): backref = "default_hook" form_fields = ["active"] runner = DefaultRunner - - @classmethod - def install(cls, project, dbobj): - """ Method called to install the hook for a project. - - :arg project: a ``pagure.model.Project`` object to which the hook - should be installed - - """ - repopaths = [pagure.utils.get_repo_path(project)] - - cls.base_install(repopaths, dbobj, "default", "default_hook.py") - - @classmethod - def remove(cls, project): - """ Method called to remove the hook of a project. - - :arg project: a ``pagure.model.Project`` object to which the hook - should be installed - - """ - repopaths = [pagure.utils.get_repo_path(project)] - - cls.base_remove(repopaths, "default") diff --git a/pagure/hooks/pagure_force_commit.py b/pagure/hooks/pagure_force_commit.py index 120ef1b..28a5482 100644 --- a/pagure/hooks/pagure_force_commit.py +++ b/pagure/hooks/pagure_force_commit.py @@ -124,33 +124,3 @@ class PagureForceCommitHook(BaseHook): form_fields = ["branches", "active"] hook_type = "pre-receive" runner = PagureForceCommitRunner - - @classmethod - def install(cls, project, dbobj): - """ Method called to install the hook for a project. - - :arg project: a ``pagure.model.Project`` object to which the hook - should be installed - - """ - # Init the git repo in case - repopaths = [get_repo_path(project)] - pygit2.Repository(repopaths[0]) - - cls.base_install( - repopaths, - dbobj, - "pagureforcecommit", - "pagure_force_commit_hook.py", - ) - - @classmethod - def remove(cls, project): - """ Method called to remove the hook of a project. - - :arg project: a ``pagure.model.Project`` object to which the hook - should be installed - - """ - repopaths = [get_repo_path(project)] - cls.base_remove(repopaths, "pagureforcecommit") diff --git a/pagure/hooks/pagure_hook.py b/pagure/hooks/pagure_hook.py index eddf446..6f5a651 100644 --- a/pagure/hooks/pagure_hook.py +++ b/pagure/hooks/pagure_hook.py @@ -308,39 +308,3 @@ class PagureHook(BaseHook): db_object = PagureTable backref = "pagure_hook" form_fields = ["active"] - - @classmethod - def install(cls, project, dbobj): - """ Method called to install the hook for a project. - - :arg project: a ``pagure.model.Project`` object to which the hook - should be installed - - """ - repopaths = [get_repo_path(project)] - for folder in [ - pagure_config.get("DOCS_FOLDER"), - pagure_config.get("REQUESTS_FOLDER"), - ]: - if folder: - repopaths.append(os.path.join(folder, project.path)) - - cls.base_install(repopaths, dbobj, "pagure", "pagure_hook.py") - - @classmethod - def remove(cls, project): - """ Method called to remove the hook of a project. - - :arg project: a ``pagure.model.Project`` object to which the hook - should be installed - - """ - repopaths = [get_repo_path(project)] - for folder in [ - pagure_config.get("DOCS_FOLDER"), - pagure_config.get("REQUESTS_FOLDER"), - ]: - if folder: - repopaths.append(os.path.join(folder, project.path)) - - cls.base_remove(repopaths, "pagure") diff --git a/pagure/hooks/pagure_no_new_branches.py b/pagure/hooks/pagure_no_new_branches.py index 7b223ba..5751d5b 100644 --- a/pagure/hooks/pagure_no_new_branches.py +++ b/pagure/hooks/pagure_no_new_branches.py @@ -95,32 +95,3 @@ class PagureNoNewBranchesHook(BaseHook): form_fields = ["active"] hook_type = "pre-receive" runner = PagureNoNewBranchRunner - - @classmethod - def install(cls, project, dbobj): - """ Method called to install the hook for a project. - - :arg project: a ``pagure.model.Project`` object to which the hook - should be installed - - """ - repopaths = [get_repo_path(project)] - - cls.base_install( - repopaths, - dbobj, - "pagure_no_new_branches", - "pagure_no_new_branches", - ) - - @classmethod - def remove(cls, project): - """ Method called to remove the hook of a project. - - :arg project: a ``pagure.model.Project`` object to which the hook - should be installed - - """ - repopaths = [get_repo_path(project)] - - cls.base_remove(repopaths, "pagure_no_new_branches") diff --git a/pagure/hooks/pagure_unsigned_commits.py b/pagure/hooks/pagure_unsigned_commits.py index 35741f8..4120f0b 100644 --- a/pagure/hooks/pagure_unsigned_commits.py +++ b/pagure/hooks/pagure_unsigned_commits.py @@ -123,32 +123,3 @@ class PagureUnsignedCommitHook(BaseHook): form_fields = ["active"] hook_type = "pre-receive" runner = PagureUnsignerRunner - - @classmethod - def install(cls, project, dbobj): - """ Method called to install the hook for a project. - - :arg project: a ``pagure.model.Project`` object to which the hook - should be installed - - """ - repopaths = [get_repo_path(project)] - - cls.base_install( - repopaths, - dbobj, - "pagureunsignedcommit", - "pagure_block_unsigned.py", - ) - - @classmethod - def remove(cls, project): - """ Method called to remove the hook of a project. - - :arg project: a ``pagure.model.Project`` object to which the hook - should be installed - - """ - repopaths = [get_repo_path(project)] - - cls.base_remove(repopaths, "pagureunsignedcommit")