@@ -288,9 +288,9 @@ def get_hosts(self):
288288 else :
289289 if (self .args .check is True and (
290290 self .args .file is None or self .args .pre_snapfile is None or self .args .post_snapfile is None )):
291- self .logger .error (
292- "Arguments not given correctly, Please refer help message" ,
293- extra = self .log_detail )
291+ self .logger .error (colorama . Fore . RED +
292+ "Arguments not given correctly, Please refer help message" ,
293+ extra = self .log_detail )
294294 self .parser .print_help ()
295295 sys .exit (1 )
296296 self .login (output_file )
@@ -373,16 +373,16 @@ def login(self, output_file):
373373 try :
374374 k = self .main_file ['hosts' ][0 ]
375375 except KeyError as ex :
376- self .logger .error (
377- "\n ERROR occurred !! Hostname not given properly %s" %
378- str (ex ),
379- extra = self .log_detail )
376+ self .logger .error (colorama . Fore . RED +
377+ "\n ERROR occurred !! Hostname not given properly %s" %
378+ str (ex ),
379+ extra = self .log_detail )
380380 #raise Exception(ex)
381381 except Exception as ex :
382- self .logger .error (
383- "\n ERROR occurred !! %s" %
384- str (ex ),
385- extra = self .log_detail )
382+ self .logger .error (colorama . Fore . RED +
383+ "\n ERROR occurred !! %s" %
384+ str (ex ),
385+ extra = self .log_detail )
386386 #raise Exception(ex)
387387 else :
388388 # when group of devices are given, searching for include keyword in
@@ -559,16 +559,16 @@ def connect(self, hostname, username, password, output_file,
559559 action ,
560560 post_snap )
561561 else :
562- self .logger .error (
563- "\n ERROR occurred %s" %
564- str (ex ),
565- extra = self .log_detail )
562+ self .logger .error (colorama . Fore . RED +
563+ "\n ERROR occurred %s" %
564+ str (ex ),
565+ extra = self .log_detail )
566566 raise Exception (ex )
567567 except Exception as ex :
568- self .logger .error (
569- "\n ERROR occurred %s" %
570- str (ex ),
571- extra = self .log_detail )
568+ self .logger .error (colorama . Fore . RED +
569+ "\n ERROR occurred %s" %
570+ str (ex ),
571+ extra = self .log_detail )
572572 raise Exception (ex )
573573 else :
574574 self .generate_rpc_reply (
@@ -761,10 +761,10 @@ def extract_dev_data(
761761 hostname ,
762762 config_data )
763763 except Exception as ex :
764- self .logger .error (
765- "\n ERROR occurred %s" %
766- str (ex ),
767- extra = self .log_detail )
764+ self .logger .error (colorama . Fore . RED +
765+ "\n ERROR occurred %s" %
766+ str (ex ),
767+ extra = self .log_detail )
768768 else :
769769 res = True
770770 if action in ["snapcheck" , "check" ]:
@@ -873,8 +873,8 @@ def check_arguments(self):
873873 (self .args .snapcheck is True and self .args .file is None ) or
874874 (self .args .check is True and self .args .file is None )
875875 ):
876- self .logger .error (
877- "Arguments not given correctly, Please refer help message" , extra = self .log_detail )
876+ self .logger .error (colorama . Fore . RED +
877+ "Arguments not given correctly, Please refer help message" , extra = self .log_detail )
878878 self .parser .print_help ()
879879 sys .exit (1 )
880880 if self .args .diff is True :
0 commit comments