mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-27 04:41:26 -07:00
Fix pep8 errors in unarchive module
This commit is contained in:
parent
52032b80d4
commit
e81c976636
2 changed files with 6 additions and 6 deletions
|
@ -55,14 +55,14 @@ class ActionModule(object):
|
||||||
|
|
||||||
source = template.template(self.runner.basedir, source, inject)
|
source = template.template(self.runner.basedir, source, inject)
|
||||||
if '_original_file' in inject:
|
if '_original_file' in inject:
|
||||||
source = utils.path_dwim_relative(inject['_original_file'], 'files', source, self.runner.basedir)
|
source = utils.path_dwim_relative(inject['_original_file'], 'files', source, self.runner.basedir)
|
||||||
else:
|
else:
|
||||||
source = utils.path_dwim(self.runner.basedir, source)
|
source = utils.path_dwim(self.runner.basedir, source)
|
||||||
|
|
||||||
remote_md5 = self.runner._remote_md5(conn, tmp, dest)
|
remote_md5 = self.runner._remote_md5(conn, tmp, dest)
|
||||||
if remote_md5 != '3':
|
if remote_md5 != '3':
|
||||||
result = dict(failed=True, msg="dest must be an existing dir")
|
result = dict(failed=True, msg="dest must be an existing dir")
|
||||||
return ReturnData(conn=conn, result=result)
|
return ReturnData(conn=conn, result=result)
|
||||||
|
|
||||||
# transfer the file to a remote tmp location
|
# transfer the file to a remote tmp location
|
||||||
tmp_src = tmp + 'source'
|
tmp_src = tmp + 'source'
|
||||||
|
|
|
@ -96,7 +96,7 @@ class _tgzfile(object):
|
||||||
def is_unarchived(self):
|
def is_unarchived(self):
|
||||||
dirof = os.path.dirname(self.dest)
|
dirof = os.path.dirname(self.dest)
|
||||||
destbase = os.path.basename(self.dest)
|
destbase = os.path.basename(self.dest)
|
||||||
cmd = 'tar -v -C "%s" --diff -%sf "%s"' % (self.dest, self.zipflag,self.src )
|
cmd = 'tar -v -C "%s" --diff -%sf "%s"' % (self.dest, self.zipflag,self.src)
|
||||||
rc, out, err = self.module.run_command(cmd)
|
rc, out, err = self.module.run_command(cmd)
|
||||||
bool = True if rc == 0 else False
|
bool = True if rc == 0 else False
|
||||||
return dict( bool = bool, rc = rc , out = out, err = err, cmd = cmd)
|
return dict( bool = bool, rc = rc , out = out, err = err, cmd = cmd)
|
||||||
|
@ -138,7 +138,7 @@ class _tarxz(_tgzfile):
|
||||||
self.zipflag = 'J'
|
self.zipflag = 'J'
|
||||||
|
|
||||||
# try handlers in order and return the one that works or bail if none work
|
# try handlers in order and return the one that works or bail if none work
|
||||||
def pick_handler (src,dest,module):
|
def pick_handler(src,dest,module):
|
||||||
handlers = [_tgzfile, _zipfile, _tarfile, _tarbzip, _tarxz]
|
handlers = [_tgzfile, _zipfile, _tarfile, _tarbzip, _tarxz]
|
||||||
for handler in handlers:
|
for handler in handlers:
|
||||||
obj = handler(src,dest,module)
|
obj = handler(src,dest,module)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue