Use ansi colors only on interactive terminal
import copy
import json
+import sys
from datetime import datetime, timedelta
import random
from enum import Enum
@@ -327,6 +328,10 @@ class Ansi:
RESET = "\u001b[0m"
+if not hasattr(sys.stderr, "isatty") or not sys.stderr.isatty():
+ [setattr(Ansi, color, '') for color in dir(Ansi) if color[0] != '_']
+
+
class ClientWrapper:
def __init__(self, pod_, namespace):
self.ip = pod_['pod_ip']
