Skip to content

Commit

Permalink
fix(kernel_crawler): enforce kernelversion to be a string.
Browse files Browse the repository at this point in the history
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
  • Loading branch information
FedeDP authored and poiana committed Aug 3, 2023
1 parent b056143 commit bb69a6f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion kernel_crawler/flatcar.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@ def list_repos(self):
return repos

def to_driverkit_config(self, release, deps):
return repo.DriverKitConfig(release, "flatcar", None, 1, list(deps)[0])
return repo.DriverKitConfig(release, "flatcar", None, "1", list(deps)[0])
2 changes: 1 addition & 1 deletion kernel_crawler/oracle.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,6 @@ def to_driverkit_config(self, release, deps):
# example:
# # uname -a
# Linux vm-ol8 5.15.0-100.96.32.el8uek.x86_64 #2 SMP Tue ...
return repo.DriverKitConfig(release, "ol", dep, kernelversion=2)
return repo.DriverKitConfig(release, "ol", dep, kernelversion="2")
else: # else return default with kernelversion=1
return repo.DriverKitConfig(release, "ol", dep)
2 changes: 2 additions & 0 deletions kernel_crawler/repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ def __str__(self):

class DriverKitConfig(object):
def __init__(self, kernelrelease, target, headers=None, kernelversion="1", kernelconfigdata=None):
if not isinstance(kernelversion, str):
raise TypeError('kernelversion should be a string')
self.kernelversion = kernelversion
self.kernelrelease = kernelrelease
self.target = target
Expand Down

0 comments on commit bb69a6f

Please sign in to comment.