Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR:autopromote:exceptions must derive from BaseException #60

Open
MScottBlake opened this issue Oct 22, 2021 · 1 comment
Open

ERROR:autopromote:exceptions must derive from BaseException #60

MScottBlake opened this issue Oct 22, 2021 · 1 comment

Comments

@MScottBlake
Copy link
Contributor

While testing the new allowlist and denylist functionality in autopromote, I encountered an error.

I had this in my json:

"denylist": {
    "Zoom": "5.7.4.898"
},
"allowlist": {
    "Zoom": "5\\..*"
},

In this test, the goal is to only promote Zoom 5.x except for 5.7.4.898.

The script output looks like this:

[ snip ]
INFO:autopromote:Considering package Zoom 5.7.1.499
INFO:autopromote:Considering package Zoom 5.7.6.1320
INFO:autopromote:Considering package Zoom 5.7.4.898
ERROR:autopromote:exceptions must derive from BaseException
Traceback (most recent call last):
  File "autopromote.py", line 473, in <module>
    main()
  File "autopromote.py", line 465, in main
    raise e
  File "autopromote.py", line 455, in main
    promotions = promote_pkgs(PKGINFOS_PATHS)
  File "autopromote.py", line 389, in promote_pkgs
    promoted, result = promote_pkg(plist, path)
  File "autopromote.py", line 299, in promote_pkg
    if not permitted(name, version):
  File "autopromote.py", line 266, in permitted
    raise f"{name} is in both allow and deny lists!"
TypeError: exceptions must derive from BaseException
@MScottBlake
Copy link
Contributor Author

I'm not sure how to best handle it, but I sort of assume that lines 265-266 were intended to be this instead.

    if allowed and denied:
        logger.warning(f"{name} is in both allow and deny lists!")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant