Subject: Specifying (or not specifying) a host gives python errors
Date: Fri, 24 Jan 2014 18:13:44 +0000
Package: dput-ng
Version: 1.7
Severity: important
I needed to set the permsission for a Debian Maintainer and found a
doc that said dput-ng had a 'dcut dm' option to do this.
That meant upgrading to testing as dcut-ng in not installable on
stable (due to python:any dep). A backport would be good there.
However I can't get it to do anything useful
$ dcut dm --uid 3FD37230 --allow libpaper paper psutils plptools
Traceback (most recent call last):
File "/usr/bin/dcut", line 82, in <module>
profile = dput.profile.load_profile(None)
File "/usr/lib/python2.7/dist-packages/dput/profile.py", line 205, in load_profile
obj = config.get_config(block)
File "/usr/lib/python2.7/dist-packages/dput/profile.py", line 137, in get_config
obj = config.get_config(name)
File "/usr/lib/python2.7/dist-packages/dput/configs/dputcf.py", line 137, in get_config
items = self.parser.items(name)
File "/usr/lib/python2.7/ConfigParser.py", line 655, in items
for option in options]
File "/usr/lib/python2.7/ConfigParser.py", line 669, in _interpolate
option, section, rawval, e.args[0])
ConfigParser.InterpolationMissingOptionError: Bad value substitution:
section: [wookstuff]
option : incoming
key : ppa
rawval : ~%(ppa)s/ubuntu
Which isn't very helpful but it looks like it might be trying the
wrong upload host.
So man dput tells me I can specify one so I try some more things:
$ dcut ftpmaster dm --uid 3FD37230 --allow psutils paper libpaper
plptoolsTraceback (most recent call last):
File "/usr/bin/dcut", line 80, in <module>
profile = dput.profile.load_profile(known.host)
File "/usr/lib/python2.7/dist-packages/dput/profile.py", line 200, in load_profile
raise DputConfigurationError("Error, was given host, "
dput.exceptions.DputConfigurationError: Error, was given host, but
we don't know about it.
Looks like the host name is blank?
I seem to get the same error whatever I put in as the second parameter
I probably just need to do some config, but the error handling here
needs to be improved. note that I am a dupload user by default so may
not have dput config correctly set up. (I did try using dput once but
it had a major shortcoming: trying to change mode on ssh uploads
_after uploading the changes file, which is incomptiable with
inotify-based things that monitor incoming (you get a race) so I went
back to dupload).
Aha 'ftp-master' works (helpful manpage example - thank-you).
So now I get a sensible error message about UIDs and keyrings, which
is fair enough.
So my bug is 'give useful error messages from unknown or
incorrectly-defaulted hosts', not a nasty python slurge.
That message could say something like 'See the 'HOST' section in the
dput manpage for details of valid names'
cheers
-- System Information:
Debian Release: jessie/sid
APT prefers testing
APT policy: (500, 'testing'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 3.2.0-4-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages dput-ng depends on:
ii python-dput 1.7
pn python:any <none>
Versions of packages dput-ng recommends:
ii bash-completion 1:2.1-2
dput-ng suggests no packages.
-- no debconf information
Acknowledgement sent
to Paul Tagliamonte <[email protected]>:
Extra info received and forwarded to list. Copy sent to dput-ng Maintainers <[email protected]>.
(Tue, 04 Mar 2014 01:54:04 GMT) (full text, mbox, link).
Yo, Wookey, sorry for the lag, I totally missed this and only caught it
by looking over open bugs.
My fault completely. I'm very sorry.
On Fri, Jan 24, 2014 at 06:13:44PM +0000, Wookey wrote:
> I needed to set the permsission for a Debian Maintainer and found a
> doc that said dput-ng had a 'dcut dm' option to do this.
>
> That meant upgrading to testing as dcut-ng in not installable on
> stable (due to python:any dep). A backport would be good there.
ACK. I did one a few weeks back, sorry it took so long.
> However I can't get it to do anything useful
>
> $ dcut dm --uid 3FD37230 --allow libpaper paper psutils plptools
> Traceback (most recent call last):
> File "/usr/bin/dcut", line 82, in <module>
> profile = dput.profile.load_profile(None)
> File "/usr/lib/python2.7/dist-packages/dput/profile.py", line 205, in load_profile
> obj = config.get_config(block)
> File "/usr/lib/python2.7/dist-packages/dput/profile.py", line 137, in get_config
> obj = config.get_config(name)
> File "/usr/lib/python2.7/dist-packages/dput/configs/dputcf.py", line 137, in get_config
> items = self.parser.items(name)
> File "/usr/lib/python2.7/ConfigParser.py", line 655, in items
> for option in options]
> File "/usr/lib/python2.7/ConfigParser.py", line 669, in _interpolate
> option, section, rawval, e.args[0])
> ConfigParser.InterpolationMissingOptionError: Bad value substitution:
> section: [wookstuff]
> option : incoming
> key : ppa
> rawval : ~%(ppa)s/ubuntu
Uh, yikes. This is not an error I've seen in a long time - this happens
when something's not expanding right in the ConfigParser (e.g. it
somehow didn't set the ppa value whilst rendering the config object),
which shouldn't happen (but it did, and that sucks, very sorry about
that).
> Which isn't very helpful but it looks like it might be trying the
> wrong upload host.
I agree. Super not helpful and I agree it looks like it's trying the
wrong host.
> So man dput tells me I can specify one so I try some more things:
>
> $ dcut ftpmaster dm --uid 3FD37230 --allow psutils paper libpaper
> plptoolsTraceback (most recent call last):
> File "/usr/bin/dcut", line 80, in <module>
> profile = dput.profile.load_profile(known.host)
> File "/usr/lib/python2.7/dist-packages/dput/profile.py", line 200, in load_profile
> raise DputConfigurationError("Error, was given host, "
> dput.exceptions.DputConfigurationError: Error, was given host, but
> we don't know about it.
This is the error I'd expect to see. Could it be that the package name
was the name of an active profile and it assumed it was the target? Is
there a profile called plptools on your box?
> Looks like the host name is blank?
>
> I seem to get the same error whatever I put in as the second parameter
ftp-master - the error should be a bit more helpful, but that's seeing
"ftpmaster" which isn't a valid host (since it's "ftp-master"), but I
agree this also sucks.
> I probably just need to do some config, but the error handling here
> needs to be improved. note that I am a dupload user by default so may
> not have dput config correctly set up. (I did try using dput once but
> it had a major shortcoming: trying to change mode on ssh uploads
> _after uploading the changes file, which is incomptiable with
> inotify-based things that monitor incoming (you get a race) so I went
> back to dupload).
Hurm, interesting. Do you know offhand how dupload handles this? I'd
love to fix this.
> Aha 'ftp-master' works (helpful manpage example - thank-you).
Ah, right. Glad you found it. Sorry about that.
> So now I get a sensible error message about UIDs and keyrings, which
> is fair enough.
(which I'm about to clean up more)
> So my bug is 'give useful error messages from unknown or
> incorrectly-defaulted hosts', not a nasty python slurge.
I agree. Very sorry.
>
> That message could say something like 'See the 'HOST' section in the
> dput manpage for details of valid names'
The command "dirt hosts" shows some entries, perhaps I need to dump
these when we get an "invalid" name.
Thanks for the report, sorry it took so long to reply.
Cheers,
Paul
--
.''`. Paul Tagliamonte <[email protected]> | Proud Debian Developer
: :' : 4096R / 8F04 9AD8 2C92 066C 7352 D28A 7B58 5B30 807C 2A87
`. `'` http://people.debian.org/~paultag
`- http://people.debian.org/~paultag/conduct-statement.txt
Debbugs is free software and licensed under the terms of the GNU General
Public License version 2. The current version can be obtained
from https://bugs.debian.org/debbugs-source/.