-
Notifications
You must be signed in to change notification settings - Fork 161
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
Snap components #2166
Snap components #2166
Conversation
Specify nvidia 510 to for dry-run drivers matching purposes. Co-authored-by: Dan Bungert <[email protected]>
0e12b84
to
a0f1a0e
Compare
FFE: LP:#2099950 |
Co-authored-by: Dan Bungert <[email protected]>
a0f1a0e
to
9212dc5
Compare
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.
One inline comment but everything else looks great to me, thanks!
def snap_of_type(self, typ: ModelSnapType) -> Optional[ModelSnap]: | ||
for snap in self.snaps: | ||
if snap.type == typ: | ||
return snap | ||
return None |
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.
nit: this only gets the first of the type in the list. From the name and usage it seems expected that there's only one of this type, which is true for the kernel (could we ever have more?), but it wouldn't work for say typ=ModelSnapType.APP
where we already have multiple.
I think instead we want something like:
def snap_of_type(self, typ: ModelSnapType) -> Optional[ModelSnap]: | |
for snap in self.snaps: | |
if snap.type == typ: | |
return snap | |
return None | |
def snaps_of_type(self, typ: ModelSnapType) -> List[ModelSnap]: | |
return [snap for snap in self.snaps if snap.type == typ] |
and have the caller make the assertion about the number of them?
I wouldn't say it's blocking and think it's fine to fix this in a follow up though.
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.
If we had the scenario of multiple recommended drivers, and matching component versions, prefer the newer ones.
9212dc5
to
ceea355
Compare
No description provided.