softwarefactory-project / rdopkg

power to the packagers
Apache License 2.0
28 stars 21 forks source link

Running rdopkg over fedora28 and python3 give us NameError: name 'basestring' is not defined" #163

Closed qinqon closed 5 years ago

qinqon commented 5 years ago

We have some jobs a tripleo upstream CI that are running at fedora 28 using python 3, one of our roles 'build-test-packages' calls rdopkg command to get the project name, and they fail, the command is the following:

rdopkg findpkg -s python-tripleoclient -l rdoinfo

We have a review to fix this https://softwarefactory-project.io/r/#/c/14080/ but would be nice to have some unit test that cover that

This generates the following backtrace:

File "/home/ellorent/dlrn-venv/bin/rdopkg", line 11, in <module>
sys.exit(main())
File "/home/ellorent/dlrn-venv/lib/python3.6/site-packages/rdopkg/[cli.py](http://cli.py)", line 46, in main
sys.exit(rdopkg(*cargs))
File "/home/ellorent/dlrn-venv/lib/python3.6/site-packages/rdopkg/[cli.py](http://cli.py)", line 38, in rdopkg
return [shell.run](http://shell.run)(runner, cargs=cargs, version=**version**)
File "/home/ellorent/dlrn-venv/lib/python3.6/site-packages/rdopkg/[shell.py](http://shell.py)", line 87, in run
action_runner.engage()
File "/home/ellorent/dlrn-venv/lib/python3.6/site-packages/rdopkg/[core.py](http://core.py)", line 212, in engage
new_args = self.action_[manager.run](http://manager.run)_action(step, self.args)
File "/home/ellorent/dlrn-venv/lib/python3.6/site-packages/rdopkg/[action.py](http://action.py)", line 229, in run_action
return action_fun(*fun_args)
File "/home/ellorent/dlrn-venv/lib/python3.6/site-packages/rdopkg/actions/info/[actions.py](http://actions.py)", line 68, in findpkg
rdoinfo.print_pkg(pkg)
File "/home/ellorent/dlrn-venv/lib/python3.6/site-packages/rdopkg/actionmods/[rdoinfo.py](http://rdoinfo.py)", line 274, in print_pkg
dp(pkg)
File "/home/ellorent/dlrn-venv/lib/python3.6/site-packages/rdopkg/[helpers.py](http://helpers.py)", line 172, in **call**
print_keyval(self.header, hdr, kb=True, vb=True)
 File \"/home/ellorent/dlrn-venv/lib/python3.6/site-packages/rdopkg/helpers.py\", line 150, in print_keyval
    basestring) and isinstance(                                                 
NameError: name 'basestring' is not defined"
yac commented 5 years ago

This is fixed in rdopkg-0.47.3. I opened #164 to create test coverage to prevent this in the future.