Fix None config file in session causes k8s agent to raise exception

This commit is contained in:
allegroai 2023-03-28 14:33:55 +03:00
parent 46ded2864d
commit 7f5b3c8df4

View File

@ -493,7 +493,7 @@ class K8sIntegration(Worker):
# noinspection PyProtectedMember # noinspection PyProtectedMember
config_content = ( config_content = (
self.conf_file_content or Path(session._config_file).read_text() or "" self.conf_file_content or (session._config_file and Path(session._config_file).read_text()) or ""
) + '\n{}\n'.format('\n'.join(x for x in extra_config_values if x)) ) + '\n{}\n'.format('\n'.join(x for x in extra_config_values if x))
hocon_config_encoded = config_content.encode("ascii") hocon_config_encoded = config_content.encode("ascii")