mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
Repair some import errors
This commit is contained in:
parent
f6be468a60
commit
6d9fe8d4b1
@ -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
|
||||
|
@ -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:
|
||||
|
@ -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):
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user