@@ -115,6 +115,7 @@ def __init__(self, node=None, jobname=None, params=None, jsonobj=None):
115
115
self ._firmware_dir = None
116
116
self ._af_dir = None
117
117
self ._node = node
118
+ self ._api_yaml = None
118
119
return
119
120
# load class from serialized json
120
121
if jsonobj :
@@ -135,6 +136,7 @@ def __init__(self, node=None, jobname=None, params=None, jsonobj=None):
135
136
self ._apijobname = jsonobj ['apijobname' ]
136
137
self ._storage_config = jsonobj ['storage_config' ]
137
138
self ._fragments_dir = jsonobj ['fragments_dir' ]
139
+ self ._api_yaml = jsonobj ['api_yaml' ]
138
140
return
139
141
raise ValueError ("No valid arguments provided" )
140
142
@@ -166,9 +168,10 @@ def set_workspace(self, workspace):
166
168
self ._srcdir = os .path .join (self ._workspace , "linux" )
167
169
self .init_steps ()
168
170
169
- def set_api_config (self , api_config ):
171
+ def set_api_config (self , api_yaml ):
170
172
""" Set API config """
171
- self ._api_config = api_config
173
+ print (f"[_set_api_yaml] CONTENT: { api_yaml } " )
174
+ self ._api_yaml = api_yaml
172
175
173
176
def set_storage_config (self , storage_config ):
174
177
""" Set storage config """
@@ -540,10 +543,9 @@ def submit(self, retcode):
540
543
api_token = os .environ .get ('KCI_API_TOKEN' )
541
544
if not api_token :
542
545
raise ValueError ("KCI_API_TOKEN is not set" )
543
- config = '/etc/kernelci/core/api-configs.yaml'
544
- configs = kernelci .config .load (config )
545
- api = 'staging.kernelci.org'
546
- api_config = configs ['api' ][api ]
546
+ api_config = kernelci .config .api .API .load_from_yaml (
547
+ yaml .safe_load (self ._api_yaml ), name = 'api'
548
+ )
547
549
api = kernelci .api .get_api (api_config , api_token )
548
550
# TODO/FIXME: real detailed job result
549
551
# pass fail skip incomplete
0 commit comments