mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-24 03:11:24 -07:00
Fix "import *" and resultant new things detectable from "make pyflakes"
This commit is contained in:
parent
33aa50eae7
commit
c861e0de55
4 changed files with 26 additions and 21 deletions
|
@ -20,8 +20,8 @@
|
|||
|
||||
import paramiko
|
||||
import os
|
||||
from ansible.errors import *
|
||||
|
||||
from ansible import errors
|
||||
|
||||
################################################
|
||||
|
||||
class Connection(object):
|
||||
|
@ -68,7 +68,7 @@ class ParamikoConnection(object):
|
|||
timeout=self.runner.timeout
|
||||
)
|
||||
except Exception, e:
|
||||
raise AnsibleConnectionFailed(str(e))
|
||||
raise errors.AnsibleConnectionFailed(str(e))
|
||||
return self
|
||||
|
||||
def exec_command(self, cmd):
|
||||
|
@ -79,12 +79,12 @@ class ParamikoConnection(object):
|
|||
def put_file(self, in_path, out_path):
|
||||
''' transfer a file from local to remote '''
|
||||
if not os.path.exists(in_path):
|
||||
raise AnsibleFileNotFound("file or module does not exist: %s" % in_path)
|
||||
raise errors.AnsibleFileNotFound("file or module does not exist: %s" % in_path)
|
||||
sftp = self.ssh.open_sftp()
|
||||
try:
|
||||
sftp.put(in_path, out_path)
|
||||
except IOError:
|
||||
raise AnsibleException("failed to transfer file to %s" % out_path)
|
||||
raise errors.AnsibleException("failed to transfer file to %s" % out_path)
|
||||
sftp.close()
|
||||
|
||||
def close(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue