From 16e342cf13b6101d07ef483dc966bf53741d8b0a Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Tue, 27 Oct 2015 10:41:41 +0100 Subject: [PATCH] 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. --- contrib/rh-bkr/bkr.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/contrib/rh-bkr/bkr.py b/contrib/rh-bkr/bkr.py index 48a7061053..1eb1c32d86 100755 --- a/contrib/rh-bkr/bkr.py +++ b/contrib/rh-bkr/bkr.py @@ -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"))