DevHeads.net

Using fedora-active-user: unable to find fedora_cert

Hello,

Could someone please clarify how fedora-active-user[1] is to be used? It
is unable to find the fedora_cert python bits, and fedora-packager no
longer seems to include this either[2].

[1] <a href="https://github.com/pypingou/fedora-active-user" title="https://github.com/pypingou/fedora-active-user">https://github.com/pypingou/fedora-active-user</a>
[2] <a href="https://src.fedoraproject.org/rpms/fedora-packager/blob/master/f/fedora-packager.spec#_78" title="https://src.fedoraproject.org/rpms/fedora-packager/blob/master/f/fedora-packager.spec#_78">https://src.fedoraproject.org/rpms/fedora-packager/blob/master/f/fedora-...</a>

Comments

Re: Using fedora-active-user: unable to find fedora_cert

By Didier Fabert at 05/30/2019 - 05:50

Hi Ankur,

You have to create a directory and download one file to get script working.
In the same directory of fedora-active-user.py

mkdir fedora_cert
curl -fsSL -o fedora_cert/__init__.py
<a href="https://pagure.io/fedora-packager/raw/master/f/src/fedora_cert/__init__.py" title="https://pagure.io/fedora-packager/raw/master/f/src/fedora_cert/__init__.py">https://pagure.io/fedora-packager/raw/master/f/src/fedora_cert/__init__.py</a>

I modify a little this script and send pypingou a PR[1]

Cheers,

Didier.

[1] <a href="https://github.com/pypingou/fedora-active-user/pull/13" title="https://github.com/pypingou/fedora-active-user/pull/13">https://github.com/pypingou/fedora-active-user/pull/13</a>

Le 30/05/2019 à 11:24, Ankur Sinha a écrit :

Re: Using fedora-active-user: unable to find fedora_cert

By Ankur Sinha at 05/30/2019 - 06:22

On Thu, May 30, 2019 11:50:12 +0200, Didier Fabert wrote:
Hi Didier,

Thanks for that. I've used your fork, downloaded fedora_cert as you
suggest and it works now.

Re: Using fedora-active-user: unable to find fedora_cert

By Kevin Fenzi at 05/30/2019 - 12:43

On 5/30/19 3:22 AM, Ankur Sinha wrote:
Ideally it should drop fedora-cert use entirely. It looks like currently
all it uses it for is to figure out your username. Instead it should
default to your local user name or take a --user or something. :)

I'm sure pingou would love PR's...

kevin

Re: Using fedora-active-user: unable to find fedora_cert

By Adam Williamson at 05/30/2019 - 17:38

On Thu, 2019-05-30 at 09:43 -0700, Kevin Fenzi wrote:
I'd kinda rather there was a standard way for all such things to read
the username from a standard file, because my Fedora username is not my
system username and passing --user or --username or whatever to
everything is a pain.

Things that need to do this include, just off the top of my head, the
bodhi and koji clients, fedpkg...I know some of them have
implementations of this, I don't know if they all agree on how to do
it...

Re: Using fedora-active-user: unable to find fedora_cert

By Tom Hughes at 05/30/2019 - 17:42

Don't most things look at $FAS_USERNAME for that?

There's ~/.fedora.upn as well though I'm not sure what looks
at that?

Tom

Re: Using fedora-active-user: unable to find fedora_cert

By Adam Williamson at 05/30/2019 - 17:50

On Thu, 2019-05-30 at 22:42 +0100, Tom Hughes wrote:
That's...sorta my whole point. :P Clearly if you can think of two
mechanisms and you don't know what uses which...there isn't a
standard...

(I know some things used to look at ~/.fedora.cert to figure it out,
too).

Re: Using fedora-active-user: unable to find fedora_cert

By =?ISO-8859-1?Q?... at 06/03/2019 - 06:52

Dne 30. 05. 19 v 23:50 Adam Williamson napsal(a):

Don't we have kerberos for Fedora?

Vít

Re: Using fedora-active-user: unable to find fedora_cert

By Adam Williamson at 06/03/2019 - 13:07

On Mon, 2019-06-03 at 12:52 +0200, Vít Ondruch wrote:
Sure! Another thing!

Re: Using fedora-active-user: unable to find fedora_cert

By Till Maas at 05/30/2019 - 17:02

Hi,

IMHO it should default to this:

if os.path.exists(os.path.expanduser('~/.fedora.upn')):
with open(os.path.expanduser('~/.fedora.upn'), 'r') as f:
username = f.read().replace('\n', '')
else:
username = getpass.getuser()

Kind regards
Till