Commit 8694e84d authored by Nicolas Dandrimont's avatar Nicolas Dandrimont 🤔
Browse files

Modify the remaining plugins for completeness

parent ce544f12
...@@ -43,6 +43,8 @@ from debexpo.lib import constants ...@@ -43,6 +43,8 @@ from debexpo.lib import constants
from debexpo.model import meta from debexpo.model import meta
from debexpo.model.packages import Package from debexpo.model.packages import Package
from pylons import config
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
class NotUploaderPlugin(BasePlugin): class NotUploaderPlugin(BasePlugin):
...@@ -53,7 +55,7 @@ class NotUploaderPlugin(BasePlugin): ...@@ -53,7 +55,7 @@ class NotUploaderPlugin(BasePlugin):
make sure it was uploaded by the same uploader. make sure it was uploaded by the same uploader.
""" """
packagename = self.changes['Source'] packagename = self.changes['Source']
log.debug('Checking whether the %s is in the archive already' % packagename) log.debug('Checking whether %s is in the archive already' % packagename)
package = meta.session.query(Package).filter_by(name=packagename).first() package = meta.session.query(Package).filter_by(name=packagename).first()
...@@ -68,10 +70,8 @@ class NotUploaderPlugin(BasePlugin): ...@@ -68,10 +70,8 @@ class NotUploaderPlugin(BasePlugin):
# This isn't even worth setting an outcome. # This isn't even worth setting an outcome.
else: else:
log.error('Package does not belong to uploader') log.error('Package does not belong to uploader')
self.failed('package-does-not-belong-to-user', None, constants.PLUGIN_SEVERITY_CRITICAL) self.failed('This package was previously uploaded to %s by another user' % config["debexpo.sitename"],
None,
constants.PLUGIN_SEVERITY_CRITICAL)
plugin = NotUploaderPlugin plugin = NotUploaderPlugin
outcomes = {
'package-does-not-belong-to-user' : 'The uploaded package already has a version in the archive, which was uploaded by a different user'
}
...@@ -84,5 +84,3 @@ class RemovePackagePlugin(BasePlugin): ...@@ -84,5 +84,3 @@ class RemovePackagePlugin(BasePlugin):
meta.session.commit() meta.session.commit()
plugin = RemovePackagePlugin plugin = RemovePackagePlugin
outcomes = {}
...@@ -55,10 +55,6 @@ class UbuntuVersionPlugin(BasePlugin): ...@@ -55,10 +55,6 @@ class UbuntuVersionPlugin(BasePlugin):
# This isn't even worth setting an outcome. # This isn't even worth setting an outcome.
else: else:
log.error('Package has ubuntu in the version') log.error('Package has ubuntu in the version')
self.failed('package-has-ubuntu-version', None, constants.PLUGIN_SEVERITY_CRITICAL) self.failed('The uploaded package has "ubuntu" in the version', None, constants.PLUGIN_SEVERITY_CRITICAL)
plugin = UbuntuVersionPlugin plugin = UbuntuVersionPlugin
outcomes = {
'package-has-ubuntu-version' : 'The uploaded package has "ubuntu" in the version'
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment