contrib/rh-bkr: add dummy RPM provider "none"

If you don't want to install any RPMs, this will lead to an
error sustituing $RPM_LIST template.

Add a dummy provider that can be used:

  ./bkr.py submit -r none ...

You are still expected to explicitly pass the -r argument.
We don't want to interpret a missing argument as "none" by
default, because it's a rather uncommon usecase.
This commit is contained in:
Thomas Haller 2015-10-27 10:41:41 +01:00
parent e953304dad
commit 16e342cf13

View file

@ -316,6 +316,13 @@ class UploadFile:
pass
def prepare(self, dry_run):
raise NotImplementedError("not implemented")
class UploadFileNone(UploadFile):
def __init__(self, uri, arch):
UploadFile.__init__(self, uri, arch)
def url(self):
return []
def prepare(self, dry_run):
pass
class UploadFileUrl(UploadFile):
def __init__(self, uri, arch):
UploadFile.__init__(self, uri, arch)
@ -573,6 +580,8 @@ class CmdSubmit(CmdBase):
ctor = UploadFileBrew
elif r.startswith('repo:'):
ctor = UploadFileRepo
elif r == 'none':
ctor = UploadFileNone
else:
ctor = UploadFileSsh
uf = ctor(r, self._get_var ("ARCH"))