-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStartup.py
More file actions
30 lines (26 loc) · 1.39 KB
/
Startup.py
File metadata and controls
30 lines (26 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
'''
Created on Jul 25, 2014
@author: cmelton
'''
from optparse import OptionParser
import InstanceEngine
# this functions gets the command line options for running the program
def getOptions():
parser = OptionParser()
parser.add_option("--S", dest = "ScriptFile", help = "this should be a text form of a startup script",
metavar = "STRING", type = "string", default = "echo hello")
parser.add_option("--H", dest = "HistoryFile", help = "sets location of commands history file",
metavar = "STRING", type = "string", default = "/home/cmelton/StartupCommandHistory.pickle")
parser.add_option("--N", dest = "name", help = "sets name of instance",
metavar = "STRING", type = "string")
parser.add_option("--SD", dest = "onShutdown", help = "to run on failure",
metavar = "STRING", type = "string")
parser.add_option("--PF", dest = "performanceDataFile", help = "file to write performance data",
metavar = "STRING", type = "string", default = "./perfData.tsv")
(options, args) = parser.parse_args()
return options
if __name__ == '__main__':
options=getOptions()
engine=InstanceEngine.InstanceEngine(options.ScriptFile, options.onShutdown, options.HistoryFile, options.name,
performanceDataFile=options.performanceDataFile)
engine.run()