File tree Expand file tree Collapse file tree 2 files changed +29
-29
lines changed
Expand file tree Collapse file tree 2 files changed +29
-29
lines changed Original file line number Diff line number Diff line change 1616
1717SPDX-License-Identifier: Apache-2.0
1818"""
19+
1920import datetime
2021import logging
22+ import traceback
2123
2224from typing import Optional
2325
@@ -168,7 +170,13 @@ def run_on_projects(
168170 trust = g ["trust_id" ],
169171 )
170172 else :
171- raise
173+ log .error (
174+ "Error while processing project" ,
175+ project = g ["project_id" ],
176+ req = err .request_id ,
177+ trust = g ["trust_id" ],
178+ error = traceback .format_exc (),
179+ )
172180
173181 return return_value
174182
Original file line number Diff line number Diff line change 1515
1616SPDX-License-Identifier: Apache-2.0
1717"""
18+
1819import argparse
1920import logging
2021
@@ -168,31 +169,22 @@ def connect_as(**kwargs):
168169 http_status = return_code ,
169170 )
170171
171- if return_code == 403 :
172- rv = cinder_snapshooter .utils .run_on_projects (
173- os_client ,
174- process_function ,
175- 10 ,
176- [],
177- )
178- assert rv == []
179- assert os_client .connect_as .call_args_list == [
180- mocker .call (project_id = projects [0 ][1 ]),
181- mocker .call (trust_id = projects [1 ][0 ]),
182- ]
183- assert process_function .call_args_list == [
184- mocker .call (
185- {"project_id" : projects [0 ][1 ]},
186- ),
187- mocker .call (
188- {"trust_id" : projects [1 ][0 ]},
189- ),
190- ]
191- else :
192- with pytest .raises (keystoneauth1 .exceptions .HTTPClientError ):
193- cinder_snapshooter .utils .run_on_projects (
194- os_client ,
195- process_function ,
196- 10 ,
197- [],
198- )
172+ rv = cinder_snapshooter .utils .run_on_projects (
173+ os_client ,
174+ process_function ,
175+ 10 ,
176+ [],
177+ )
178+ assert rv == []
179+ assert os_client .connect_as .call_args_list == [
180+ mocker .call (project_id = projects [0 ][1 ]),
181+ mocker .call (trust_id = projects [1 ][0 ]),
182+ ]
183+ assert process_function .call_args_list == [
184+ mocker .call (
185+ {"project_id" : projects [0 ][1 ]},
186+ ),
187+ mocker .call (
188+ {"trust_id" : projects [1 ][0 ]},
189+ ),
190+ ]
You can’t perform that action at this time.
0 commit comments