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

ansible runner client refactoring #565

Merged
merged 1 commit into from
Aug 2, 2022

Conversation

michalskrivanek
Copy link
Member

eliminate wrong use of singleton's class properties - they get
overwritten by each run. Whole state is now passed through
AnsibleReturnValue object consistently.

eliminate wrong use of singleton's class properties - they get
overwritten by each run. Whole state is now passed through
AnsibleReturnValue object consistently.
@michalskrivanek michalskrivanek changed the title [WIP] ansible runner client refactoring ansible runner client refactoring Aug 1, 2022
@michalskrivanek
Copy link
Member Author

/ost

@michalskrivanek
Copy link
Member Author

this is....ugly. but it removes the shared properties runnerLogger and returnValue from AnsibleRunnerClient singleton, and makes it thread safe.
Both returnValue and runnerClient are now instantiated locally. runnerClient is also a singleton, returnValue is not and it's now used as the "persistence" of state consistently, so couple other local variables could have been dropped.
...and it still remove more lines than it adds!

I can see that some stuff can still be removed from AnsibleReturnValue...but it looks large and risky enough.

@michalskrivanek
Copy link
Member Author

I've run couple hundred concurrent template export+import and ova export+import leveraging async measure image task and ovf query, and host upgrade checks.
I'll keep running it for few more hours....

Copy link
Member

@mwperina mwperina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM now and let's do further code improvements later

@michalskrivanek
Copy link
Member Author

seems to work really well
i hope we won't touch this code ever again;)

@michalskrivanek michalskrivanek merged commit 900550b into oVirt:master Aug 2, 2022
@michalskrivanek michalskrivanek deleted the arc-refactoring branch August 2, 2022 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants