File tree 1 file changed +5
-4
lines changed
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -86,7 +86,6 @@ class Callback:
86
86
def __init__ (self , data ):
87
87
"""This class can be used to parse LAVA callback data"""
88
88
self ._data = data
89
- self ._meta = None
90
89
91
90
def get_data (self ):
92
91
"""Get the raw callback data"""
@@ -95,12 +94,14 @@ def get_data(self):
95
94
def get_device_id (self ):
96
95
"""Get the ID of the tested device"""
97
96
return self ._data .get ('actual_device_id' )
97
+
98
+ def get_job_definition (self , key ):
99
+ """Get the job definition"""
100
+ return yaml .safe_load (self ._data .get ('definition' )).get (key )
98
101
99
102
def get_meta (self , key ):
100
103
"""Get a metadata value from the job definition"""
101
- if self ._meta is None :
102
- self ._meta = yaml .safe_load (self ._data ['definition' ])['metadata' ]
103
- return self ._meta .get (key )
104
+ return self .get_job_definition ('metadata' ).get (key )
104
105
105
106
def get_job_status (self ):
106
107
"""Get the job status"""
You can’t perform that action at this time.
0 commit comments