mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Implement proxy minion configuration
This commit is contained in:
parent
1a75be3f71
commit
2abdb19934
1 changed files with 11 additions and 2 deletions
|
@ -9,7 +9,7 @@ from __future__ import absolute_import
|
|||
import logging
|
||||
import requests
|
||||
import json
|
||||
from salt.exceptions import CommandExecutionError
|
||||
from salt.exceptions import (CommandExecutionError, MinionError)
|
||||
|
||||
|
||||
__proxyenabled__ = ['philips_hue']
|
||||
|
@ -34,10 +34,19 @@ def __virtual__():
|
|||
return True
|
||||
|
||||
|
||||
def init(opts):
|
||||
def init(cnf):
|
||||
'''
|
||||
Initialize the module.
|
||||
'''
|
||||
host = cnf.get('proxy', {}).get('host')
|
||||
if not host:
|
||||
raise MinionError(message="Cannot find 'host' parameter in the proxy configuration")
|
||||
|
||||
user = cnf.get('proxy', {}).get('user')
|
||||
if not user:
|
||||
raise MinionError(message="Cannot find 'user' parameter in the proxy configuration")
|
||||
|
||||
CONFIG['url'] = "http://{0}/api/{1}".format(host, user)
|
||||
|
||||
|
||||
def grains():
|
||||
|
|
Loading…
Add table
Reference in a new issue