> Ansuman Dash wrote:
> >Now I am trying to validate that the command is executed successfully.
> >I have written following script to validate the log file which is created
> >after running the command.
Notice what's happening here:
> > for line in f.readlines():
> > a=line
This sets a to EACH line from the file, overwriting
the previous one. What you end up with after that
executes is a holding the LAST line in the file.
> > if "Request timed out.." not in a:
> > print("Ping is not successful.")
> > pLogger.info("Ping is not successful.")
Also... this looks backwards. If "Request timed out.." is NOT found
then the ping was NOT successful?
--
Steve Willoughby | Using billion-dollar satellites
[email protected] | to hunt for Tupperware.
_______________________________________________
Tutor maillist - [email protected]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor