add md5 as checksum algorithm for stat module
This commit is contained in:
parent
cdc207061b
commit
50764b07fc
1 changed files with 2 additions and 2 deletions
|
@ -36,7 +36,7 @@ function main(arg)
|
||||||
, follow = { default=false, type='bool' }
|
, follow = { default=false, type='bool' }
|
||||||
, get_md5 = { default=true, type='bool'}
|
, get_md5 = { default=true, type='bool'}
|
||||||
, get_checksum = { default=true, type='bool' }
|
, get_checksum = { default=true, type='bool' }
|
||||||
, checksum_algorithm = { default='sha1', type='str', choices={'sha1'}, aliases={'checksum_algo', 'checksum'}}
|
, checksum_algorithm = { default='sha1', type='str', choices={'sha1', 'md5'}, aliases={'checksum_algo', 'checksum'}}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -111,7 +111,7 @@ function main(arg)
|
||||||
end
|
end
|
||||||
|
|
||||||
if 0 ~= d['isreg'] and get_checksum and 0 == unistd.access(path, "r") then
|
if 0 ~= d['isreg'] and get_checksum and 0 == unistd.access(path, "r") then
|
||||||
local chksums = { sha1=File.sha1 }
|
local chksums = { sha1=File.sha1, md5=File.md5 }
|
||||||
d['checksum'] = chksums[p['checksum_algorithm']](module, path)
|
d['checksum'] = chksums[p['checksum_algorithm']](module, path)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue