Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vdk-control-cli: Modify how data is written to job config.ini #2982

Merged
merged 1 commit into from
Dec 22, 2023

Conversation

doks5
Copy link
Contributor

@doks5 doks5 commented Dec 21, 2023

Currently, the _set_value() logic in JobConfig uses fileinput.input() to traverse the contents of the job config file, and update the keys passed. This works as expected on python versions up to 3.11. It, however breaks on python3.11 on some platforms. For example, it works fine on Ubuntu, but the config file gets truncated on photonOS (the operating system used for the secure base images), which causes job creation failures.

This change modifies the _set_value() logic to directly read and write the config file's contents, and drops the use of fileinput.

Testing Done: Added test, and did some local testing using docker containers with different host OSs.

Currently, the `_set_value()` logic in **JobConfig** uses `fileinput.input()` to traverse the contents of
the job config file, and update the keys passed. This works as expected on python versions up to 3.11. It,
however breaks on python3.11 on some platforms. For example, it works fine on Ubuntu, but the config file
gets truncated on photonOS (the operating system used for the secure base images), which causes job creation
failures.

This change modifies the `_set_value()` logic to directly read and write the config file's contents, and drops
the use of *fileinput*.

Testing Done: Added test, and did some local testing using docker containers with different host OSs.

Signed-off-by: Andon Andonov <andonova@vmware.com>
@doks5 doks5 force-pushed the person/andonova/control-cli-read-config branch from e3e3cc9 to ac10a42 Compare December 22, 2023 14:45
@doks5 doks5 merged commit faf2a5f into main Dec 22, 2023
8 checks passed
@doks5 doks5 deleted the person/andonova/control-cli-read-config branch December 22, 2023 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants