@@ -163,21 +163,39 @@ def login(cli):
163
163
table = tabulate (tabular_data = summary_table , headers = ['Domain' , 'Summary' ], tablefmt = table_borders )
164
164
if cli .config .general .color :
165
165
highlighted = highlight (table , text_lexer , Terminal256Formatter (style = cli .config .general .style ))
166
- cli .echo (highlighted )
166
+ try :
167
+ cli .echo (highlighted )
168
+ except ValueError :
169
+ print (highlighted )
167
170
else :
168
- cli .echo (table )
171
+ try :
172
+ cli .echo (table )
173
+ except ValueError :
174
+ print (table )
169
175
elif cli .args .output == "yaml" :
170
176
if cli .config .general .color :
171
177
highlighted = highlight (yaml_dumps (summary_object , indent = 4 ), yaml_lexer , Terminal256Formatter (style = cli .config .general .style ))
172
- cli .echo (highlighted )
178
+ try :
179
+ cli .echo (highlighted )
180
+ except ValueError :
181
+ print (highlighted )
173
182
else :
174
- cli .echo (yaml_dumps (summary_object , indent = 4 ))
183
+ try :
184
+ cli .echo (yaml_dumps (summary_object , indent = 4 ))
185
+ except ValueError :
186
+ print (yaml_dumps (summary_object , indent = 4 ))
175
187
elif cli .args .output == "json" :
176
188
if cli .config .general .color :
177
189
highlighted = highlight (json_dumps (summary_object , indent = 4 ), json_lexer , Terminal256Formatter (style = cli .config .general .style ))
178
- cli .echo (highlighted )
190
+ try :
191
+ cli .echo (highlighted )
192
+ except ValueError :
193
+ print (highlighted )
179
194
else :
180
- cli .echo (json_dumps (summary_object , indent = 4 ))
195
+ try :
196
+ cli .echo (json_dumps (summary_object , indent = 4 ))
197
+ except ValueError :
198
+ print (json_dumps (summary_object , indent = 4 ))
181
199
else : # if eval
182
200
nonf = """
183
201
# helper function logs out from NetFoundry
@@ -212,9 +230,15 @@ def login(cli):
212
230
"""
213
231
if cli .config .general .color :
214
232
highlighted = highlight (token_env , bash_lexer , Terminal256Formatter (style = cli .config .general .style ))
215
- cli .echo (highlighted )
233
+ try :
234
+ cli .echo (highlighted )
235
+ except ValueError :
236
+ print (highlighted )
216
237
else :
217
- cli .echo (token_env )
238
+ try :
239
+ cli .echo (token_env )
240
+ except ValueError :
241
+ print (token_env )
218
242
219
243
220
244
@cli .subcommand ('logout your identity for the current current profile' )
@@ -541,15 +565,27 @@ def get(cli, echo: bool = True, spinner: object = None):
541
565
if cli .args .output in ["yaml" , "text" ]:
542
566
if cli .config .general .color :
543
567
highlighted = highlight (yaml_dumps (filtered_match , indent = 4 ), yaml_lexer , Terminal256Formatter (style = cli .config .general .style ))
544
- cli .echo (highlighted )
568
+ try :
569
+ cli .echo (highlighted )
570
+ except ValueError :
571
+ print (highlighted )
545
572
else :
546
- cli .echo (yaml_dumps (filtered_match , indent = 4 ))
573
+ try :
574
+ cli .echo (yaml_dumps (filtered_match , indent = 4 ))
575
+ except ValueError :
576
+ print (yaml_dumps (filtered_match , indent = 4 ))
547
577
elif cli .args .output == "json" :
548
578
if cli .config .general .color :
549
579
highlighted = highlight (json_dumps (filtered_match , indent = 4 ), json_lexer , Terminal256Formatter (style = cli .config .general .style ))
550
- cli .echo (highlighted )
580
+ try :
581
+ cli .echo (highlighted )
582
+ except ValueError :
583
+ print (highlighted )
551
584
else :
552
- cli .echo (json_dumps (filtered_match , indent = 4 ))
585
+ try :
586
+ cli .echo (json_dumps (filtered_match , indent = 4 ))
587
+ except ValueError :
588
+ print (json_dumps (filtered_match , indent = 4 ))
553
589
elif len (matches ) == 0 :
554
590
cli .log .warn (f"found no { cli .args .resource_type } by '{ ', ' .join (query_keys )} '" )
555
591
sysexit (1 )
@@ -651,7 +687,7 @@ def list(cli, spinner: object = None):
651
687
'edgeRouterAttributes' , 'serviceAttributes' , 'endpointAttributes' ,
652
688
'status' , 'zitiId' , 'provider' , 'locationCode' , 'ipAddress' , 'networkVersion' ,
653
689
'active' , 'default' , 'region' , 'size' , 'attributes' , 'email' , 'productVersion' ,
654
- 'state' ]
690
+ 'state' , 'address' , 'binding' ]
655
691
valid_keys = set (matches [0 ].keys ()) & set (default_columns )
656
692
657
693
if valid_keys :
@@ -688,15 +724,27 @@ def list(cli, spinner: object = None):
688
724
elif cli .args .output == "yaml" :
689
725
if cli .config .general .color :
690
726
highlighted = highlight (yaml_dumps (filtered_matches , indent = 4 ), yaml_lexer , Terminal256Formatter (style = cli .config .general .style ))
691
- cli .echo (highlighted )
727
+ try :
728
+ cli .echo (highlighted )
729
+ except ValueError :
730
+ print (highlighted )
692
731
else :
693
- cli .echo (yaml_dumps (filtered_matches , indent = 4 ))
732
+ try :
733
+ cli .echo (yaml_dumps (filtered_matches , indent = 4 ))
734
+ except ValueError :
735
+ print (yaml_dumps (filtered_matches , indent = 4 ))
694
736
elif cli .args .output == "json" :
695
737
if cli .config .general .color :
696
738
highlighted = highlight (json_dumps (filtered_matches , indent = 4 ), json_lexer , Terminal256Formatter (style = cli .config .general .style ))
697
- cli .echo (highlighted )
739
+ try :
740
+ cli .echo (highlighted )
741
+ except ValueError :
742
+ print (highlighted )
698
743
else :
699
- cli .echo (json_dumps (filtered_matches , indent = 4 ))
744
+ try :
745
+ cli .echo (json_dumps (filtered_matches , indent = 4 ))
746
+ except ValueError :
747
+ print (json_dumps (filtered_matches , indent = 4 ))
700
748
701
749
702
750
@cli .argument ('query' , arg_only = True , action = StoreDictKeyPair , nargs = '?' , help = "query params as k=v,k=v comma-separated pairs" )
0 commit comments