@@ -405,7 +405,7 @@ def get(cli, echo: bool = True, embed='all', spinner: object = None):
405
405
if 'id' in query_keys :
406
406
if len (query_keys ) > 1 :
407
407
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 )} '" )
409
409
match = organization .get_organization (id = cli .args .query ['id' ])
410
410
else :
411
411
matches = organization .find_organizations (** cli .args .query )
@@ -415,7 +415,7 @@ def get(cli, echo: bool = True, embed='all', spinner: object = None):
415
415
if 'id' in query_keys :
416
416
if len (query_keys ) > 1 :
417
417
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 )} '" )
419
419
match = networks .get_network_domain_resource (resource_type = cli .args .resource_type , id = cli .args .query ['id' ])
420
420
else :
421
421
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):
425
425
if 'id' in query_keys :
426
426
if len (query_keys ) > 1 :
427
427
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 )} '" )
429
429
match = organization .get_network_group (network_group_id = cli .args .query ['id' ])
430
430
else :
431
431
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):
435
435
if 'id' in query_keys :
436
436
if len (query_keys ) > 1 :
437
437
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 )} '" )
439
439
match = organization .get_identity (identity_id = cli .args .query ['id' ])
440
440
elif not query_keys : # return caller identity if not filtering
441
441
match = organization .caller
@@ -447,7 +447,7 @@ def get(cli, echo: bool = True, embed='all', spinner: object = None):
447
447
if 'id' in query_keys :
448
448
if len (query_keys ) > 1 :
449
449
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 )} '" )
451
451
match = organization .get_role (role_id = cli .args .query ['id' ])
452
452
else :
453
453
matches = organization .find_roles (** cli .args .query )
@@ -457,7 +457,7 @@ def get(cli, echo: bool = True, embed='all', spinner: object = None):
457
457
if 'id' in query_keys :
458
458
if len (query_keys ) > 1 :
459
459
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 )} '" )
461
461
match = organization .get_network (network_id = cli .args .query ['id' ], embed = embed , accept = cli .args .accept )
462
462
else :
463
463
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):
496
496
sysexit (1 )
497
497
if cli .args .resource_type == "data-center" :
498
498
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" )
500
500
if len (query_keys ) > 1 :
501
501
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 )} '" )
503
503
match = network .get_data_center_by_id (id = cli .args .query ['id' ])
504
504
else :
505
505
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):
509
509
if 'id' in query_keys :
510
510
if len (query_keys ) > 1 :
511
511
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 )} '" )
513
513
match = network .get_resource_by_id (type = cli .args .resource_type , id = cli .args .query ['id' ], accept = cli .args .accept )
514
514
else :
515
515
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):
547
547
else :
548
548
cli .echo (json_dumps (filtered_match , indent = 4 ))
549
549
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 )} '" )
551
551
sysexit (1 )
552
552
else : # len(matches) > 1:
553
553
if cli .args .query :
@@ -577,7 +577,7 @@ def list(cli, spinner: object = None):
577
577
cli .log .warn ("try 'get' command to get by id" )
578
578
if cli .args .output == "text" :
579
579
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 } " )
581
581
else : # output is YAML or JSON
582
582
# don't emit INFO messages to stdout because they will break deserialization
583
583
cli .log .setLevel (logging .WARN )
@@ -599,7 +599,7 @@ def list(cli, spinner: object = None):
599
599
elif cli .args .resource_type == "roles" :
600
600
if cli .args .my_roles :
601
601
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'" )
603
603
cli .args .query ['identityId' ] = organization .caller ['id' ]
604
604
matches = organization .find_roles (** cli .args .query )
605
605
else :
@@ -1061,7 +1061,8 @@ def use_organization(cli, spinner: object = None, prompt: bool = True):
1061
1061
organization = cli .config .general .organization if cli .config .general .organization else None ,
1062
1062
profile = cli .config .general .profile ,
1063
1063
expiry_minimum = 0 ,
1064
- proxy = cli .config .general .proxy
1064
+ proxy = cli .config .general .proxy ,
1065
+ logger = cli .log ,
1065
1066
)
1066
1067
except NFAPINoCredentials :
1067
1068
if prompt :
@@ -1084,7 +1085,8 @@ def use_organization(cli, spinner: object = None, prompt: bool = True):
1084
1085
organization = cli .config .general .organization if cli .config .general .organization else None ,
1085
1086
profile = cli .config .general .profile ,
1086
1087
expiry_minimum = 0 ,
1087
- proxy = cli .config .general .proxy
1088
+ proxy = cli .config .general .proxy ,
1089
+ logger = cli .log ,
1088
1090
)
1089
1091
except PyJWTError :
1090
1092
spinner .fail ("Not a valid token" )
0 commit comments