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 <[email protected]>

rh-pre-commit.version: 2.3.1
rh-pre-commit.check-secrets: ENABLED
  • Loading branch information
xiangce authored Sep 29, 2024
1 parent ccb65c1 commit 16406b4
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 @@ -940,7 +940,7 @@ def __init__(self, cmd, provider, save_as=None, context=HostContext,
deps=None, split=True, keep_rc=False, timeout=None,
inherit_env=None, override_env=None, signum=None, **kwargs):
deps = deps if deps is not None else []
self.cmd = cmd
self.cmd = cmd if six.PY3 else str(cmd)
self.provider = provider
self.save_as = save_as.strip("/") if save_as else None # strip as a relative file path
self.context = context
Expand Down

0 comments on commit 16406b4

Please sign in to comment.