Skip to content

Commit

Permalink
fix return solr + more PEP 8
Browse files Browse the repository at this point in the history
Signed-off-by: Markus Gattol <[email protected]>
  • Loading branch information
dillongreen committed Nov 14, 2011
1 parent 94c1e36 commit e0a44ee
Show file tree
Hide file tree
Showing 4 changed files with 103 additions and 78 deletions.
3 changes: 3 additions & 0 deletions salt/modules/selinux.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import os


def __virtual__():
'''
Check if the os is Linux, and then if selinux is running in permissive or
Expand All @@ -15,6 +16,7 @@ def __virtual__():
return 'selinux'
return False


def getenforce():
'''
Return the mode selinux is running in
Expand All @@ -28,6 +30,7 @@ def getenforce():
else:
return 'Enforcing'


def setenforce(mode):
'''
Set the enforcing mode
Expand Down
7 changes: 6 additions & 1 deletion salt/modules/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,18 @@
Top level package command wrapper, used to translate the os detected by the
grains to the correct service manager
'''

import os

grainmap = {
'Arch': '/etc/rc.d',
'Debian': '/etc/init.d',
'Fedora': '/etc/init.d',
'RedHat': '/etc/init.d',
'Debian': '/etc/init.d',
'Ubuntu': '/etc/init.d',
}


def start(name):
'''
Start the specified service
Expand All @@ -24,6 +26,7 @@ def start(name):
name + ' start')
return not __salt__['cmd.retcode'](cmd)


def stop(name):
'''
Stop the specified service
Expand All @@ -36,6 +39,7 @@ def stop(name):
name + ' stop')
return not __salt__['cmd.retcode'](cmd)


def restart(name):
'''
Restart the named service
Expand All @@ -48,6 +52,7 @@ def restart(name):
name + ' restart')
return not __salt__['cmd.retcode'](cmd)


def status(name, sig=None):
'''
Return the status for a service, returns the PID or an empty string if the
Expand Down
5 changes: 3 additions & 2 deletions salt/modules/shadow.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
'''
Manage the shadow file
'''
# Import python libs

import os
import spwd


def info(name):
'''
Return the information for the specified user
Expand Down Expand Up @@ -36,6 +37,7 @@ def info(name):
'expire': ''}
return ret


def set_password(name, password):
'''
Set the password for a named user, the password must be a properly defined
Expand Down Expand Up @@ -65,4 +67,3 @@ def set_password(name, password):
if uinfo['pwd'] == password:
return True
return False

Loading

0 comments on commit e0a44ee

Please sign in to comment.