File tree Expand file tree Collapse file tree 3 files changed +10
-8
lines changed
Expand file tree Collapse file tree 3 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -378,7 +378,6 @@ def get_parser(self, prog_name):
378378
379379 def take_action (self , parsed_args ):
380380 volume_client = self .app .client_manager .volume
381- compute_client = self .app .client_manager .compute
382381
383382 if parsed_args .long :
384383 columns = (
@@ -420,7 +419,8 @@ def take_action(self, parsed_args):
420419 # Cache the server list
421420 server_cache = {}
422421 try :
423- for s in compute_client .servers .list ():
422+ compute_client = self .app .client_manager .sdk_connection .compute
423+ for s in compute_client .servers ():
424424 server_cache [s .id ] = s
425425 except Exception :
426426 # Just forget it if there's any trouble
Original file line number Diff line number Diff line change 2020import logging
2121
2222from cliff import columns as cliff_columns
23+ from openstack import exceptions as sdk_exceptions
2324from osc_lib .cli import format_columns
2425from osc_lib .cli import parseractions
2526from osc_lib .command import command
@@ -507,10 +508,10 @@ def take_action(self, parsed_args):
507508 server_cache = {}
508509 if do_server_list :
509510 try :
510- compute_client = self .app .client_manager .compute
511- for s in compute_client .servers . list ():
511+ compute_client = self .app .client_manager .sdk_connection . compute
512+ for s in compute_client .servers ():
512513 server_cache [s .id ] = s
513- except Exception :
514+ except sdk_exceptions . SDKException :
514515 # Just forget it if there's any trouble
515516 pass # nosec: B110
516517 AttachmentsColumnWithCache = functools .partial (
Original file line number Diff line number Diff line change 2020import logging
2121
2222from cliff import columns as cliff_columns
23+ from openstack import exceptions as sdk_exceptions
2324from openstack import utils as sdk_utils
2425from osc_lib .cli import format_columns
2526from osc_lib .cli import parseractions
@@ -522,10 +523,10 @@ def take_action(self, parsed_args):
522523 server_cache = {}
523524 if do_server_list :
524525 try :
525- compute_client = self .app .client_manager .compute
526- for s in compute_client .servers . list ():
526+ compute_client = self .app .client_manager .sdk_connection . compute
527+ for s in compute_client .servers ():
527528 server_cache [s .id ] = s
528- except Exception :
529+ except sdk_exceptions . SDKException :
529530 # Just forget it if there's any trouble
530531 pass # nosec: B110
531532 AttachmentsColumnWithCache = functools .partial (
You can’t perform that action at this time.
0 commit comments