#1522 example profile script fails with AttributeError
Closed: Fixed 4 years ago by tkopecek. Opened 4 years ago by ktdreyer.

https://docs.pagure.org/koji/profiles/ has an example script to print all the settings for a given Koji profile. It loops through two profiles ("koji" and "ppc-koji") and prints the settings for each one.

When I copy and paste that script to a test.py file on my computer and run it, it fails:

$ python test.py 
Traceback (most recent call last):
  File "test.py", line 7, in <module>
    print("PROFILE: %s" % i.config.profile)
AttributeError: Values instance has no attribute 'profile'

I had to replace "ppc-koji" with "cbs" to match a real profile that I had on my computer, but otherwise the code is identical to the sample in the documentation:

$ cat test.py
python
import koji

fedora_koji = koji.get_profile_module("koji")
ppc_koji = koji.get_profile_module("cbs")

for i in (fedora_koji, ppc_koji):
    print("PROFILE: %s" % i.config.profile)
    for key, value in sorted(i.config.__dict__.items()):
        print("    %s = %s" % (key, value))
    print("")

Reading get_profile_module() in koji/__init__.py, I cannot see where config.profile is set.


Hmm, it seems, it never was there. On the other hand it could be useful.

Metadata Update from @tkopecek:
- Custom field Size adjusted to None

4 years ago

Metadata Update from @dgregor:
- Issue priority set to: Low (was: Normal)
- Issue set to the milestone: 1.20

4 years ago

Metadata Update from @jcupova:
- Issue tagged with: testing-done

4 years ago

Login to comment on this ticket.

Metadata
Related Pull Requests
  • #1525 Merged 4 years ago