mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #38004 from terminalmage/issue37969
Fix regression in user/group mgmt for archive.extracted
This commit is contained in:
commit
1ac53e5196
2 changed files with 20 additions and 2 deletions
|
@ -606,7 +606,7 @@ def extracted(name,
|
|||
|
||||
if user:
|
||||
uid = __salt__['file.user_to_uid'](user)
|
||||
if not uid:
|
||||
if uid == '':
|
||||
ret['comment'] = 'User {0} does not exist'.format(user)
|
||||
return ret
|
||||
else:
|
||||
|
@ -614,7 +614,7 @@ def extracted(name,
|
|||
|
||||
if group:
|
||||
gid = __salt__['file.group_to_gid'](group)
|
||||
if not gid:
|
||||
if gid == '':
|
||||
ret['comment'] = 'Group {0} does not exist'.format(group)
|
||||
return ret
|
||||
else:
|
||||
|
|
|
@ -119,6 +119,24 @@ class ArchiveTest(integration.ModuleCase,
|
|||
|
||||
self._check_ext_remove(ARCHIVE_DIR, UNTAR_FILE)
|
||||
|
||||
@skipIf(os.geteuid() != 0, 'you must be root to run this test')
|
||||
def test_archive_extracted_with_root_user_and_group(self):
|
||||
'''
|
||||
test archive.extracted without skip_verify
|
||||
only external resources work to check to
|
||||
ensure source_hash is verified correctly
|
||||
'''
|
||||
ret = self.run_state('archive.extracted', name=ARCHIVE_DIR,
|
||||
source=ARCHIVE_TAR_SOURCE, archive_format='tar',
|
||||
source_hash=ARCHIVE_TAR_HASH,
|
||||
user='root', group='root')
|
||||
if 'Timeout' in ret:
|
||||
self.skipTest('Timeout talking to local tornado server.')
|
||||
|
||||
self.assertSaltTrueReturn(ret)
|
||||
|
||||
self._check_ext_remove(ARCHIVE_DIR, UNTAR_FILE)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
from integration import run_tests
|
||||
|
|
Loading…
Add table
Reference in a new issue