Merge pull request #47332 from garethgreenaway/47324_archive_extracted_keep_keep_source

[2018.3] Removing duplicate code from state/archive.py
This commit is contained in:
Nicole Thomas 2018-04-27 09:12:50 -04:00 committed by GitHub
commit efa3aab800
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -649,21 +649,6 @@ def extracted(name,
# Remove pub kwargs as they're irrelevant here.
kwargs = salt.utils.args.clean_kwargs(**kwargs)
if 'keep_source' in kwargs and 'keep' in kwargs:
ret.setdefault('warnings', []).append(
'Both \'keep_source\' and \'keep\' were used. Since these both '
'do the same thing, \'keep\' was ignored.'
)
keep_source = bool(kwargs.pop('keep_source'))
kwargs.pop('keep')
elif 'keep_source' in kwargs:
keep_source = bool(kwargs.pop('keep_source'))
elif 'keep' in kwargs:
keep_source = bool(kwargs.pop('keep'))
else:
# Neither was passed, default is True
keep_source = True
if 'keep_source' in kwargs and 'keep' in kwargs:
ret.setdefault('warnings', []).append(
'Both \'keep_source\' and \'keep\' were used. Since these both '