@@ -405,7 +405,7 @@ def get(cli, echo: bool = True, embed='all', spinner: object = None):
405405 if 'id' in query_keys :
406406 if len (query_keys ) > 1 :
407407 query_keys .remove ('id' )
408- cli .log .warning (f"using 'id' only, ignoring params: '{ ', ' .join (query_keys )} '" )
408+ cli .log .warn (f"using 'id' only, ignoring params: '{ ', ' .join (query_keys )} '" )
409409 match = organization .get_organization (id = cli .args .query ['id' ])
410410 else :
411411 matches = organization .find_organizations (** cli .args .query )
@@ -415,7 +415,7 @@ def get(cli, echo: bool = True, embed='all', spinner: object = None):
415415 if 'id' in query_keys :
416416 if len (query_keys ) > 1 :
417417 query_keys .remove ('id' )
418- cli .log .warning (f"using 'id' only, ignoring params: '{ ', ' .join (query_keys )} '" )
418+ cli .log .warn (f"using 'id' only, ignoring params: '{ ', ' .join (query_keys )} '" )
419419 match = networks .get_network_domain_resource (resource_type = cli .args .resource_type , id = cli .args .query ['id' ])
420420 else :
421421 matches = networks .find_network_domain_resources (resource_type = cli .args .resource_type , ** cli .args .query )
@@ -425,7 +425,7 @@ def get(cli, echo: bool = True, embed='all', spinner: object = None):
425425 if 'id' in query_keys :
426426 if len (query_keys ) > 1 :
427427 query_keys .remove ('id' )
428- cli .log .warning (f"using 'id' only, ignoring params: '{ ', ' .join (query_keys )} '" )
428+ cli .log .warn (f"using 'id' only, ignoring params: '{ ', ' .join (query_keys )} '" )
429429 match = organization .get_network_group (network_group_id = cli .args .query ['id' ])
430430 else :
431431 matches = organization .find_network_groups_by_organization (** cli .args .query )
@@ -435,7 +435,7 @@ def get(cli, echo: bool = True, embed='all', spinner: object = None):
435435 if 'id' in query_keys :
436436 if len (query_keys ) > 1 :
437437 query_keys .remove ('id' )
438- cli .log .warning (f"using 'id' only, ignoring params: '{ ', ' .join (query_keys )} '" )
438+ cli .log .warn (f"using 'id' only, ignoring params: '{ ', ' .join (query_keys )} '" )
439439 match = organization .get_identity (identity_id = cli .args .query ['id' ])
440440 elif not query_keys : # return caller identity if not filtering
441441 match = organization .caller
@@ -447,7 +447,7 @@ def get(cli, echo: bool = True, embed='all', spinner: object = None):
447447 if 'id' in query_keys :
448448 if len (query_keys ) > 1 :
449449 query_keys .remove ('id' )
450- cli .log .warning (f"using 'id' only, ignoring params: '{ ', ' .join (query_keys )} '" )
450+ cli .log .warn (f"using 'id' only, ignoring params: '{ ', ' .join (query_keys )} '" )
451451 match = organization .get_role (role_id = cli .args .query ['id' ])
452452 else :
453453 matches = organization .find_roles (** cli .args .query )
@@ -457,7 +457,7 @@ def get(cli, echo: bool = True, embed='all', spinner: object = None):
457457 if 'id' in query_keys :
458458 if len (query_keys ) > 1 :
459459 query_keys .remove ('id' )
460- cli .log .warning (f"using 'id' only, ignoring params: '{ ', ' .join (query_keys )} '" )
460+ cli .log .warn (f"using 'id' only, ignoring params: '{ ', ' .join (query_keys )} '" )
461461 match = organization .get_network (network_id = cli .args .query ['id' ], embed = embed , accept = cli .args .accept )
462462 else :
463463 if cli .config .general .network_group and not cli .config .general .network :
@@ -496,10 +496,10 @@ def get(cli, echo: bool = True, embed='all', spinner: object = None):
496496 sysexit (1 )
497497 if cli .args .resource_type == "data-center" :
498498 if 'id' in query_keys :
499- cli .log .warning ("data centers fetched by ID may not support this network's product version, try provider or locationCode params for safety" )
499+ cli .log .warn ("data centers fetched by ID may not support this network's product version, try provider or locationCode params for safety" )
500500 if len (query_keys ) > 1 :
501501 query_keys .remove ('id' )
502- cli .log .warning (f"using 'id' only, ignoring params: '{ ', ' .join (query_keys )} '" )
502+ cli .log .warn (f"using 'id' only, ignoring params: '{ ', ' .join (query_keys )} '" )
503503 match = network .get_data_center_by_id (id = cli .args .query ['id' ])
504504 else :
505505 matches = network .find_edge_router_data_centers (** cli .args .query )
@@ -509,7 +509,7 @@ def get(cli, echo: bool = True, embed='all', spinner: object = None):
509509 if 'id' in query_keys :
510510 if len (query_keys ) > 1 :
511511 query_keys .remove ('id' )
512- cli .log .warning (f"using 'id' only, ignoring params: '{ ', ' .join (query_keys )} '" )
512+ cli .log .warn (f"using 'id' only, ignoring params: '{ ', ' .join (query_keys )} '" )
513513 match = network .get_resource_by_id (type = cli .args .resource_type , id = cli .args .query ['id' ], accept = cli .args .accept )
514514 else :
515515 matches = network .find_resources (type = cli .args .resource_type , accept = cli .args .accept , ** cli .args .query )
@@ -547,7 +547,7 @@ def get(cli, echo: bool = True, embed='all', spinner: object = None):
547547 else :
548548 cli .echo (json_dumps (filtered_match , indent = 4 ))
549549 elif len (matches ) == 0 :
550- cli .log .warning (f"found no { cli .args .resource_type } by '{ ', ' .join (query_keys )} '" )
550+ cli .log .warn (f"found no { cli .args .resource_type } by '{ ', ' .join (query_keys )} '" )
551551 sysexit (1 )
552552 else : # len(matches) > 1:
553553 if cli .args .query :
@@ -577,7 +577,7 @@ def list(cli, spinner: object = None):
577577 cli .log .warn ("try 'get' command to get by id" )
578578 if cli .args .output == "text" :
579579 if not stdout .isatty ():
580- cli .log .warning (f"use --output=yaml or json for scripting { cli .prog_name } " )
580+ cli .log .warn (f"use --output=yaml or json for scripting { cli .prog_name } " )
581581 else : # output is YAML or JSON
582582 # don't emit INFO messages to stdout because they will break deserialization
583583 cli .log .setLevel (logging .WARN )
@@ -599,7 +599,7 @@ def list(cli, spinner: object = None):
599599 elif cli .args .resource_type == "roles" :
600600 if cli .args .my_roles :
601601 if cli .args .query .get ('identityId' ):
602- cli .log .warning ("got --my-roles, ignoring param 'identityId'" )
602+ cli .log .warn ("got --my-roles, ignoring param 'identityId'" )
603603 cli .args .query ['identityId' ] = organization .caller ['id' ]
604604 matches = organization .find_roles (** cli .args .query )
605605 else :
@@ -1061,7 +1061,8 @@ def use_organization(cli, spinner: object = None, prompt: bool = True):
10611061 organization = cli .config .general .organization if cli .config .general .organization else None ,
10621062 profile = cli .config .general .profile ,
10631063 expiry_minimum = 0 ,
1064- proxy = cli .config .general .proxy
1064+ proxy = cli .config .general .proxy ,
1065+ logger = cli .log ,
10651066 )
10661067 except NFAPINoCredentials :
10671068 if prompt :
@@ -1084,7 +1085,8 @@ def use_organization(cli, spinner: object = None, prompt: bool = True):
10841085 organization = cli .config .general .organization if cli .config .general .organization else None ,
10851086 profile = cli .config .general .profile ,
10861087 expiry_minimum = 0 ,
1087- proxy = cli .config .general .proxy
1088+ proxy = cli .config .general .proxy ,
1089+ logger = cli .log ,
10881090 )
10891091 except PyJWTError :
10901092 spinner .fail ("Not a valid token" )
0 commit comments