Repair some import errors

This commit is contained in:
Thomas S Hatch 2012-08-30 23:07:06 -06:00
parent f6be468a60
commit 6d9fe8d4b1
5 changed files with 12 additions and 4 deletions

View File

@ -4,12 +4,15 @@ A module for shelling out
Keep in mind that this module is insecure, in that it can give whomever has
access to the master root execution access to all salt minions
'''
# Import Python libs
import pipes
import logging
import os
import shutil
import subprocess
import tempfile
# Import Salt libs
import salt.utils
from salt.exceptions import CommandExecutionError
from salt.grains.extra import shell as shell_grain

View File

@ -269,7 +269,6 @@ def rm_auth_key(user, key, config='.ssh/authorized_keys'):
# not an auth ssh key, perhaps a blank line
continue
opts = ln.group(1)
comps = ln.group(2).split()
if len(comps) < 2:

View File

@ -544,7 +544,7 @@ def touch(name, atime=None, mtime=None):
else:
times = (atime, mtime)
os.utime(name, times)
except TypeError as exc:
except TypeError:
msg = "atime and mtime must be integers"
raise SaltInvocationError(msg)
except (IOError, OSError):

View File

@ -236,7 +236,7 @@ def remove(pkg):
'''
old = list_pkgs()
cmd = 'yum -q -y remove ' + pkg
retcode = __salt__['cmd.retcode'](cmd)
__salt__['cmd.retcode'](cmd)
new = list_pkgs()
return _list_removed(old, new)

View File

@ -1,4 +1,9 @@
'''
Define some generic socket functions for network modules
'''
# Import Python libs
import socket
from string import ascii_letters, digits
def _sanitize_host(host):
'''
@ -8,6 +13,7 @@ def _sanitize_host(host):
c for c in host[0:255] if c in (ascii_letters + digits + '.-')
])
def isportopen(host, port):
'''
Return status of a port