mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Set up the initial calling of the minion routines
This commit is contained in:
parent
0673733d6c
commit
83169cc6e3
1 changed files with 47 additions and 0 deletions
|
@ -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
|
Loading…
Add table
Reference in a new issue