Don't pass -u on AIX

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
This commit is contained in:
Clinton Wolfe 2021-02-25 14:31:13 -05:00
parent 75762ecd62
commit 0f1b1f5c5c

View file

@ -67,8 +67,14 @@ module Inspec::Resources
end
def crontab_cmd
# TODO: the -u scenario needs to be able to do sudo
@user.nil? ? "crontab -l" : "crontab -l -u #{@user}"
if @user.nil?
"crontab -l"
elsif inspec.os.aix?
"crontab -l #{@user}"
else
# TODO: the -u scenario needs to be able to do sudo
"crontab -l -u #{@user}"
end
end
filter = FilterTable.create