defectdojo_api icon indicating copy to clipboard operation
defectdojo_api copied to clipboard

python3 compat?

Open cyrinux opened this issue 6 years ago • 6 comments

Hi,

I got this running example, after adding () to print() in dojo_populate.py, i got this one.

» ❯ python3 dojo_populate.py
Traceback (most recent call last):
  File "dojo_populate.py", line 27, in <module>
    dd = defectdojo.DefectDojoAPI(host, api_key, user, debug=False)
  File "/home/cyril/trydefectdojoapi/venv/lib/python3.7/site-packages/defectdojo_api/defectdojo.py", line 37, in __init__
    if host.split('/') > 3:
TypeError: '>' not supported between instances of 'list' and 'int'

Thanks for help

cyrinux avatar Jul 27 '19 11:07 cyrinux

I have the same problem.

Martin2877 avatar Apr 06 '21 05:04 Martin2877

seems an error in one of the scripts. @Martin2877 @cyrinux The code your referring to was modified by @aaronweaver on Aug 14, 2018 => https://github.com/DefectDojo/defectdojo_api/commit/0eab5e58028f4a9044af6a06c06985a37b243248#diff-398ee4538a05ce9f45dc774f83e67aa783e808ab48aa91ad9ec26ce22bd2fb26

damiencarol avatar Apr 06 '21 10:04 damiencarol

i have the same problem but using defectdojo_api==1.1.3 helped

jyotiraws avatar Oct 05 '21 21:10 jyotiraws

Any updates on this?

benmeyer50 avatar Nov 22 '21 19:11 benmeyer50

You can quickfix it in site-packages/defectdojo_api/defectdojo.py Replace: if host.split('/') > 3: By: if len(host.split('/')) > 3:

or build it from GitHub :)

Siryu6 avatar Dec 30 '21 16:12 Siryu6

FYI: this piece of code was removed in https://github.com/DefectDojo/defectdojo_api/commit/0eab5e58028f4a9044af6a06c06985a37b243248#diff-398ee4538a05ce9f45dc774f83e67aa783e808ab48aa91ad9ec26ce22bd2fb26. Should it be more simple to update the module to a new version? This modification is part of 1.1.4

damiencarol avatar Dec 31 '21 15:12 damiencarol