-
Notifications
You must be signed in to change notification settings - Fork 874
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
Revert ds identify optimization #4797
Revert ds identify optimization #4797
Conversation
Not against a revert, but would it be better to add a warning/error upstream, and then patch this behavior downstream? |
9191a03
to
d752615
Compare
We could do that, but by doing so we are choosing to break users when we don't have to in a common scenario of mistaken configuration (i.e.: "I thought cloud.cfg was a yaml file, what gives?"). I'm in agreement for complaining louder when user configurations are wrong, but I don't want to do that without actually making it reasonable for users to fix their issues. Most users aren't going to know to go digging However, if we only warn about this issue, that still leaves the part of this that amplifies #4796 unfixed (which I haven't mentioned directly yet). Notice the (non-xfail) MAAS tests. Do we really want cloud-init to run I think that I would be on board with just making a user-friendly warning in upstream releases and not making ds-identify silently ignore invalid configurations, however commit 816e05d introduced more broken behavior than just that (and it doesn't break invalid configurations in a user-friendly way), which is why I propose reverting - at least for now.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, you raise good points. I was initially thinking we could have ds-identify fail more loudly if it can't parse something correctly, but that requires more smarts than ds-identify currently has (hence this issue).
self._test_ds_found(config) | ||
|
||
def test_maas_not_detected_2(self): | ||
"""Don't incorrectly identify maas |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Think it's worth putting an issue/commit reference in all of these tests (not just the xfail)? They just feel a bit random without the underlying context and if approaching otherwise I would think "why are we only testing maas here and not every other single datasource?"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Think it's worth putting an issue/commit reference in all of these tests
I think you missed the rest of the docstring?
The bug reported in 4794 combined with the previously existing bug reported in 4796 made for very loose MAAS false-positives.
Or maybe I misunderstand what you are asking for.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added more context to the tests.
tests/unittests/test_ds_identify.py
Outdated
config = "LXD-kvm-not-MAAS-3" | ||
self._test_ds_found(config) | ||
|
||
# fmt: off |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why's this needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
black disagrees about how to format the docstring. If you turn that off, black will require """
at the end of the single-line string, which makes it longer than 79 characters long.
@smoser fyi ^^ |
…anonical#4327)" This reverts commit 816e05d. Reopens LP: 2030729 Fixes canonicalGH-4794
d752615
to
9b1659f
Compare
Additional Context
Reported in #4794, when an invalid configuration includes an invalid (empty)
datasource_list
, ds-identify will identify the wrong datasource.While the datasource_list is invalid, it does represent a regression because previous ds-identify behavior was to silently ignore the invalid configuration and now it needlessly prevents cloud-init from running rather than identifying the correct datasource like it used to.
This issue was introduced in #4327.
Test Steps
Merge type