runner.py 937 Bytes
Newer Older
1
import sys
2
import subprocess
3

4
def executeRunner(args):
5
  """Start the instance configure. this may run a python script, move or/and rename
6 7 8
  file or directory when dondition is filled. the condition may be when file exist or when an entry
  exist into database.
  """
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
  arguments, delete, rename, chmod, data = args
  if delete != []:
    print "Calling lampconfigure with 'delete' arguments"
    result = subprocess.Popen(arguments + delete)
    result.wait()
  if rename != []:
    for parameters in rename:
      print "Calling lampconfigure with 'rename' arguments"
      result = subprocess.Popen(arguments + parameters)
      result.wait()
  if chmod != []:
    print "Calling lampconfigure with 'chmod' arguments"
    result = subprocess.Popen(arguments + chmod)
    result.wait()
  if data != []:
    print "Calling lampconfigure with 'run' arguments"
    result = subprocess.Popen(arguments + data)
    result.wait()
27
    return