python programming for multiple path copy and read from default path -
i coping file in default path reading verification. if read fails need copy copy in default path again , read.
present logic follows, can 1 suggest syntax copy in path copy bakcup default in failed case?
#copying dump cpdump = "cp -rf "+dumpconst.hmc_default_dump_offload_path + i_dump_name + \ " "+destpath self.testlog("copying dump file "+i_dump_name+" path==>"+destpath) try: l_fw_con.su_command(suid, destname, supasswd,cpdump,suidpasswd) except lcbcommandserror,e: raise dumphelpererror(fwerrors.sysdump_setup_error,\ "unable copy dump file.reason:"+e.reason) except sshconnectionerror,e: raise dumphelpererror(fwerrors.sysdump_setup_error,e.reason) self.testlog("dump file copy mount path==>[completed]") dump_verify_tool = dumpconst.dump_verification_tool_dir + \ dumpconst.dump_verification_util self.testlog("dump content verification==>[in progress]") #run content verification try: cmd = dump_verify_tool + mountpoint+"/dumps/"+i_dump_name l_result = lcbcmd.sulcbexecute(cmd) except (lcbconnectionerror, lcbcommandserror) e: self.errorlog(str(e)) raise dumphelpererror(fwerrors.sysdump_setup_error,\ "dump verification tool execution failed. " + "reason: " + e.reason)
Comments
Post a Comment