Set up the initial calling of the minion routines

This commit is contained in:
Thomas S Hatch 2011-02-20 22:11:43 -07:00
parent 0673733d6c
commit 83169cc6e3

View file

@ -0,0 +1,47 @@
'''
Make me some salt!
'''
# Import python libs
import os
import optparse
# Import salt libs
import salt.master
import salt.minion
import salt.utils
class Master(object):
'''
Creates a master server
'''
class Minion(object):
'''
Create a minion server
'''
def __init__(self):
self.cli = self.__parse_cli()
self.opts = salt.utils.minion_config(self.cli)
def __parse_cli(self):
'''
Parse the cli input
'''
parser = optparse.OptionParser()
parser.add_option('-f',
'--foreground',
dest='foreground',
default=False,
action='store_true',
help='Run the minion in the foreground')
parser.add_option('-c',
'--config',
dest='config',
default='/etc/salt/minion',
help='Pass in an alternative configuration file')
options, args = parser.parse_args()
cli = {'foreground': options.foreground,
'config': options.config}
return cli