Closed Vogtinator closed 1 year ago
THX for your contribution
@Vogtinator @M0ses unfortunately this fix is not compatible with CentOS 7 (python 3.6):
[ 88s] Traceback (most recent call last):
[ 88s] File "/usr/lib/obs/service/tar", line 30, in <module>
[ 88s] main()
[ 88s] File "/usr/lib/obs/service/tar", line 26, in main
[ 88s] TarSCM.run()
[ 88s] File "/usr/lib/obs/service/TarSCM/__init__.py", line 39, in run
[ 88s] task_list.process_list()
[ 88s] File "/usr/lib/obs/service/TarSCM/tasks.py", line 132, in process_list
[ 88s] self.process_single_task(task)
[ 88s] File "/usr/lib/obs/service/TarSCM/tasks.py", line 212, in process_single_task
[ 88s] self.scm_object = scm_object = scm_class(args, self)
[ 88s] File "/usr/lib/obs/service/TarSCM/scm/base.py", line 82, in __init__
[ 88s] self._calc_repocachedir()
[ 88s] File "/usr/lib/obs/service/TarSCM/scm/base.py", line 234, in _calc_repocachedir
[ 88s] repocachedir = Config().get('tar_scm', 'CACHEDIRECTORY')
[ 88s] File "/usr/lib/obs/service/TarSCM/config.py", line 47, in __init__
[ 88s] self.configs.append(self._init_config(fname))
[ 88s] File "/usr/lib/obs/service/TarSCM/config.py", line 70, in _init_config
[ 88s] config.read_string(fake_header + open(fname, 'r').read(),
[ 88s] AttributeError: RawConfigParser instance has no attribute 'read_string'
[ 88s] service run failed for service 'tar'
https://build.opensuse.org/package/live_build_log/home:bluca:dpdk/dpdk-20.11/CentOS_7/x86_64
Any idea if there's a way to make it work there too?
read_string
was introduced in Python 3.2. Does it use python 2 by chance?
Hard to tell from that log - both python2 and python3 are installed, that much can be seen, so maybe it is?
-bash-4.2$ head /usr/lib/obs/service/tar
#!/usr/bin/python
urgh
@adrianschroeter @dirkmueller @M0ses Is there a reason why on those platforms it uses python 2 still and we can't switch over?
That CI support for py2 was removed makes dealing with this a bit annoying.
The easiest option here is probably to keep the old code around in case if "read_string" not in dir(config)
...
Is there a reason why on those platforms it uses python 2 still and we can't switch over?
e.g. CentOS7 is missing python3-dateutil
I merged a new commit - https://github.com/openSUSE/obs-service-tar_scm/pull/477
Fixes #474