@@ -709,28 +709,6 @@ def list(cli, echo: bool = True, spinner: object = None):
709709 cli .log .debug ("not filtering output keys" )
710710 filtered_matches = matches
711711
712- if cli .config .list .names :
713- # map any property names that look like a resource ID to the appropriate resource type so we can look up the name later
714- type_by_prop = dict ()
715- for key in valid_keys :
716- if key not in ['zitiId' ]:
717- if key in IDENTITY_ID_PROPERTIES :
718- type_by_prop [key ] = 'identities'
719- elif key .endswith ('Id' ):
720- type_by_prop [key ] = propid2type (key )
721-
722- for match in filtered_matches : # for each match
723- if any_in (type_by_prop .keys (), match .keys ()): # if at least one property points to a resolvable ID (fast)
724- for k , v in match .items (): # for each key in match (slow)
725- if type_by_prop .get (k ): # if this is the property that points to a resolvable ID
726- if v is None :
727- cli .log .debug (f"unexpected value for { k } = { v } " )
728- continue
729- # get the resource with the name we're after
730- resource , status = get_generic_resource_by_type_and_id (setup = organization , resource_type = type_by_prop [k ], resource_id = v )
731- if resource .get ('name' ): # if the name property isn't empty
732- match [k ] = f"{ resource ['name' ]} " # wedge the name into the ID column
733-
734712 # if echo=False then return the object and parent objects instead of printing with an output format
735713 if not echo :
736714 return filtered_matches , organization
0 commit comments