Update copy image logic to match create image.#828
Update copy image logic to match create image.#828illfelder wants to merge 2 commits intoapache:trunkfrom
Conversation
|
/cc @supertom |
|
cc @tonybaloney |
|
Friendly ping? |
|
Sorry for the delay. Looks fine and tests/lint check pass. We've now duplicated that guest_os_feature check in both the create and copy methods - what do you think about creating a helper function to reduce the duplication (any chance of any other API exposing this somehow)? Also, are there more guest_os_features coming? Should we make a static list? |
|
I moved the functions together for that purpose and considered writing a helper function. I decided against it for two reasons.
We will want to add more guest_os_features in the near future, so it should be a static list. Any suggestions for where I should put that? Define a global variable in the file? |
|
Updated to make the feature a static list. |
|
Thanks for adding the list of OS features. I agree, the functions should be combined, but we can deal with that later on. LGTM. |
| }, | ||
| } | ||
|
|
||
| if guest_os_features: |
There was a problem hiding this comment.
It looks like the same logic is duplicated in ex_create_image method.
It would be great if it can be refactored in a shared utility method to avoid duplication and make maintenance easier.
There was a problem hiding this comment.
I agree - if you take a look at the conversation thread for the pull request, we discuss exactly that change.
There was a problem hiding this comment.
The TL;DR from the conversation was that the duplicated functionality I add will only be used by those two functions, so it doesn't make sense to move it into a helper. The two functions, however, should be combined since they do (essentially) the same thing. That should be done as a separate pull request. Do you have any other concerns before merging?
|
Any concerns about merging? |
Image "guestOsFeatures" should behave the same during image copy and creation.
Description
Status
done, ready for review
Checklist (tick everything that applies)