mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Fix lint.
This commit is contained in:
parent
08f1a43ff0
commit
6927251c09
4 changed files with 14 additions and 10 deletions
|
@ -33,6 +33,8 @@ def _remove_complex_types(dictionary):
|
|||
elif hasattr(v, 'to_eng_string'):
|
||||
dictionary[k] = v.to_eng_string()
|
||||
|
||||
return dictionary
|
||||
|
||||
|
||||
def defaults():
|
||||
return {'os': 'proxy', 'kernel': 'unknown', 'osrelease': 'proxy'}
|
||||
|
@ -47,4 +49,3 @@ def facts():
|
|||
|
||||
def os_family():
|
||||
return {'os_family': 'junos'}
|
||||
|
||||
|
|
|
@ -5,9 +5,6 @@ Provide the service module for the proxy-minion REST sample
|
|||
# Import python libs
|
||||
from __future__ import absolute_import
|
||||
import logging
|
||||
import os
|
||||
import re
|
||||
import salt.ext.six as six
|
||||
|
||||
__proxyenabled__ = ['rest_sample']
|
||||
|
||||
|
@ -29,6 +26,7 @@ def __virtual__():
|
|||
return __virtualname__
|
||||
return False
|
||||
|
||||
|
||||
def get_all():
|
||||
'''
|
||||
Return a list of all available services
|
||||
|
@ -99,10 +97,9 @@ def status(name, sig):
|
|||
salt '*' service.status <service name>
|
||||
'''
|
||||
|
||||
proxy_fn = 'rest_sample'+ '.service_status'
|
||||
resp = __opts__['proxymodule'][proxy_fn](name)
|
||||
proxy_fn = 'rest_sample' + '.service_status'
|
||||
resp = __opts__['proxymodule'][proxy_fn](name)
|
||||
if resp['comment'] == 'stopped':
|
||||
return { name: False }
|
||||
return {name: False}
|
||||
if resp['comment'] == 'running':
|
||||
return { name: True }
|
||||
|
||||
return {name: True}
|
||||
|
|
|
@ -37,18 +37,22 @@ log = logging.getLogger(__name__)
|
|||
def conn():
|
||||
return thisproxy['conn']
|
||||
|
||||
|
||||
def facts():
|
||||
return thisproxy['conn'].facts
|
||||
|
||||
|
||||
def refresh():
|
||||
return thisproxy['conn'].facts_refresh()
|
||||
|
||||
|
||||
def proxytype():
|
||||
'''
|
||||
Returns the name of this proxy
|
||||
'''
|
||||
return 'junos'
|
||||
|
||||
|
||||
def id(opts):
|
||||
'''
|
||||
Returns a unique ID for this proxy minion
|
||||
|
@ -60,7 +64,7 @@ def ping():
|
|||
'''
|
||||
Ping? Pong!
|
||||
'''
|
||||
thisproxy['conn'].connected
|
||||
return thisproxy['conn'].connected
|
||||
|
||||
|
||||
def shutdown(opts):
|
||||
|
@ -75,5 +79,6 @@ def shutdown(opts):
|
|||
except Exception:
|
||||
pass
|
||||
|
||||
|
||||
def rpc():
|
||||
return json.dumps(thisproxy['conn'].rpc.get_software_information())
|
||||
|
|
|
@ -33,6 +33,7 @@ def __virtual__():
|
|||
log.debug('rest_sample proxy __virtual__() called...')
|
||||
return True
|
||||
|
||||
|
||||
def init(opts):
|
||||
'''
|
||||
Every proxy module needs an 'init', though you can
|
||||
|
|
Loading…
Add table
Reference in a new issue