Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tar_extract can't use a GID, only a group name. #67

Open
doctor-jan opened this issue May 11, 2020 · 0 comments
Open

tar_extract can't use a GID, only a group name. #67

doctor-jan opened this issue May 11, 2020 · 0 comments

Comments

@doctor-jan
Copy link

doctor-jan commented May 11, 2020

Cookbook version

2.2.0

Chef-client version

Chef Infra Client: 15.7.32

Platform Details

Fedora release 31 (Thirty One)

Scenario:

The documentation says I can set 'group' to either a group name or a GID. If I set a GID, I get a type error because the property type is set to 'String', rather than ['String', 'Integer'].

Steps to Reproduce:

tar_extract tarball do
target_dir '/home/user'
download_dir '/tmp'
user 'user'
group 1001
creates '/home/user/dir/file'
end

Expected Result:

I'd expect the tar ball to be extracted with files owned by user 'user' and group id 1001.

Actual Result:

A type error is shown because the GID is an integer, not a string.

Fix:

I was able to resolve this issue by changing resources/extract.rb:
Change line 29 from:
property :group, String, default: node['root_group']
to:
property :group, [String, Integer], default: node['root_group']

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant