python - subprocess.Popen gets stuck for long time? -


When I run the Python Script (Bootstrap.py) on white, it runs correctly, but when I switch it to another medium Try to run from script (automation.py) it gets trapped

// automation.py

  #! / Usr / bin / env dragon import system import option select subprocess global flag failcount = 0 def infra-fill (): global failaccount failaccount + = 1 debit watchfile (): fp = open ('BootStrap.log', 'r') print " Press #_input () at any of the #_input () in the fp.readlines () for "If" Boot Script Score: 3010 "contains: #import pdb # pdb.set_trace () global flag flag = 0 fp.close () parser = Optparse.OptionParser () parser.add_option ('- c', '- count', Dest = 'counter', help = 'Time should be rebooted' (options, args) = parser.parse_args () #counter = 1 If options No one. Counter = 1 Other: Counter = Option Counter Count = 0 Output = "" mylist = ['--cfgfile = "BDXT0_PO_0.cfg"', '--cfgfile = "BDXT0_PO_OVR_0.cfg"', '-scbypass', '--dmipy = "C: \ \ SFD \\ JG \\ KDG \\ dmi_pcie_p o.py"', '--fusestr = "IA_CORE_DISABLE = 0y111111111111111111111110"', '--fusestr = "HT_DIS = 1"', 'Earbreakpy =' c: \\ dvfdfv \\ dskf \\ lsvcd \\ config_restart .i "() '' '' '' ''. '']] Logfile = Open ('BootStrap.log', 'w ') After # etc .___ (' 3010 '): # Category for category (int): global flag flag = 1 logfile = for proc.stdout line (' BootStrap.log ',' w ') proc = subprocess.Popen ([' Python ',' bdxBootScript.py ', mylist], stdout = subprocess.PIPE, stderr = subprocess.STDOUT): Sys.stdout.write (line) logfile.write (Line) proc.wait () count = coun T + 1 print "file close" logfile.close () readfile () #global flag Flag: incrfailcount () if flagged: "Error occurred in% dth repetition"% count remaining: printed "failed number = 0: Print "Script failed% d"% (failed number, count)% d times% code>  
 I'm trying to automate Bootstrap.py ** What does the program do? ** Here it is Bootstrap.py which runs arguments. The output of bootscript.py is checked for the specific line (Boatraspit Score: 3010) If this currently appears as a failure and failure, then this script has been run multiple times for the counter number ** What do I need? ** This script has been stuck for a long time, I want to execute it with Sextak, like I myself have been running the bootstrap manually   

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -