[elbe-devel] [PATCH v2] repomanager: fix key unlock for existing repo

Torben Hohn torben.hohn at linutronix.de
Tue Apr 30 09:57:15 CEST 2019


On Tue, Apr 30, 2019 at 09:52:35AM +0200, Manuel Traut wrote:
> On 09:42 Tue 30 Apr     , Torben Hohn wrote:
> > On Tue, Apr 30, 2019 at 09:34:39AM +0200, Manuel Traut wrote:
> > > the gnupg key should be unlocked by the repomanager constructor.
> > > However "elbe prjrepo upload_pkg" fails with the following error:
> > > 
> > > --8<--
> > > running cmd +reprepro --basedir
> > > "/var/cache/elbe/e9c6c678-669b-4d6c-b822-d432e62a78ea/repo" export jessie+
> > > ------------------------------------------------------------------------------
> > > gpgme gave error Pinentry:32870:  Inappropriate ioctl for device
> > > ERROR: Could not finish exporting 'jessie'!
> > > There have been errors!
> > > ------------------------------------------------------------------------------
> > > Command failed with errorcode 251
> > > --8<--
> > > 
> > > This is because the SignWith line in reprepos distribution configuration
> > > was not parsed correctly.
> > > 
> > > Signed-off-by: Manuel Traut <manut at linutronix.de>
> > > ---
> > >  elbepack/repomanager.py | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > 
> > > diff --git a/elbepack/repomanager.py b/elbepack/repomanager.py
> > > index a1b4f500..c17dc70b 100644
> > > --- a/elbepack/repomanager.py
> > > +++ b/elbepack/repomanager.py
> > > @@ -88,7 +88,7 @@ class RepoBase(object):
> > >          # generate a new key and generate repository config
> > >          if self.fs.isdir("/"):
> > >              repo_conf = self.fs.read_file("conf/distributions")
> > > -            for l in repo_conf:
> > > +            for l in repo_conf.split('\n'):
> > >                  if l.startswith("SignWith"):
> > >                      self.keyid = l.split(" ")[1]
> > 
> > use .strip() here.                              ^^^^^^
> 
> strip() on an array is not allowed.
> 
> I thought a bit about that line as i wrote the code.
> And came up with the conclusion that the file is generated by elbe code,
> so we can be pretty sure about the format.
> 
> However maybe we wanna have sth. like:
> self.keyid = l.split(":")[1].strip()


i meant: l.split(" ")[1].strip()

> 
> 
> > >                      unlock_key(self.keyid)
> > > -- 
> > > 2.20.1
> > > 
> > 
> > -- 
> > Torben Hohn
> > Linutronix GmbH | Bahnhofstrasse 3 | D-88690 Uhldingen-Mühlhofen
> > Phone: +49 7556 25 999 18; Fax.: +49 7556 25 999 99
> > 
> > Hinweise zum Datenschutz finden Sie hier (Informations on data privacy 
> > can be found here): https://linutronix.de/kontakt/Datenschutz.php
> > 
> > Linutronix GmbH | Firmensitz (Registered Office): Uhldingen-Mühlhofen | 
> > Registergericht (Registration Court): Amtsgericht Freiburg i.Br., HRB700 
> > 806 | Geschäftsführer (Managing Directors): Heinz Egger, Thomas Gleixner
> 
> 

-- 
Torben Hohn
Linutronix GmbH | Bahnhofstrasse 3 | D-88690 Uhldingen-Mühlhofen
Phone: +49 7556 25 999 18; Fax.: +49 7556 25 999 99

Hinweise zum Datenschutz finden Sie hier (Informations on data privacy 
can be found here): https://linutronix.de/kontakt/Datenschutz.php

Linutronix GmbH | Firmensitz (Registered Office): Uhldingen-Mühlhofen | 
Registergericht (Registration Court): Amtsgericht Freiburg i.Br., HRB700 
806 | Geschäftsführer (Managing Directors): Heinz Egger, Thomas Gleixner
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.linutronix.de/pipermail/elbe-devel/attachments/20190430/fb781882/attachment.sig>


More information about the elbe-devel mailing list