~engineer-abdalla/drizzle-automation/add-html-reports

« back to all changes in this revision

Viewing changes to drizzle/automation/runner.py

  • Committer: Jay Pipes
  • Date: 2009-11-16 21:25:49 UTC
  • mfrom: (114.1.1 working)
  • Revision ID: jpipes@serialcoder-20091116212549-84b3l3wadt0vu4uh
Merge REPORT command work.

Show diffs side-by-side

added added

removed removed

Lines of Context:
124
124
  
125
125
  command= variables['command'] # lib/options.py ensures we have a command specified...
126
126
  
 
127
  from drizzle.automation.lib import db
 
128
  db.init(variables)    # Checks dependencies and required configuration variables for the DB...
 
129
 
 
130
  # Report command is different because we don't need to build
 
131
  # a server.  All we do is query the database...
 
132
  # Note that variables['report_name'] is validated in options.py
 
133
  if command == 'report':
 
134
    from drizzle.automation.reports import run as runner
 
135
    result= runner.execute(variables['report_name'], variables)
 
136
    if not result:
 
137
      logging.error("Failed to execute report. Exiting.")
 
138
      sys.exit(1)
 
139
    else:
 
140
      sys.exit(0)
 
141
  
 
142
  # All the below commands trigger a build of the server via source
 
143
  # or a sandbox.
127
144
  if command == 'sloc':
128
145
    from drizzle.automation.sloc import run as runner
129
146
  elif command == 'crashme':
141
158
  elif command == 'sysbench':
142
159
    from drizzle.automation.sysbench import run as runner
143
160
  
144
 
  from drizzle.automation.lib import db
145
 
  db.init(variables)    # Checks dependencies and required configuration variables for the DB...
146
 
  
147
161
  # OK, so we've parsed our basic configuration variables and options
148
162
  # at this point.  Now, we need to figure out what code path we need
149
163
  # to take.  When operating on a BZR branch, we use an automation