Skip to content

Commit

Permalink
fix: datasource passed unicode to foreach_execute in py26 (#4232)
Browse files Browse the repository at this point in the history
- when collecting in py26 env, if the foreach_execute specs depends
  on DatasourceProvider, the provider will be in unicode type and causes
  the followed validate() fail
- this change converted the unicode to string by force for all 'cmd' passed to
  CommandOutputProvider

Signed-off-by: Xiangce Liu <xiangceliu@redhat.com>

rh-pre-commit.version: 2.3.1
rh-pre-commit.check-secrets: ENABLED
  • Loading branch information
xiangce committed Sep 30, 2024
1 parent ccb65c1 commit 751e55d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion insights/core/spec_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ def __init__(self, cmd, ctx, root="insights_commands", save_as=None,
args=None, split=True, keep_rc=False, ds=None, timeout=None,
inherit_env=None, override_env=None, signum=None, cleaner=None):
super(CommandOutputProvider, self).__init__()
self.cmd = cmd
self.cmd = cmd if six.PY3 else str(cmd)
self.root = root
self.save_as = save_as
self.ctx = ctx
Expand Down

0 comments on commit 751e55d

Please sign in to comment.