1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

osx_defaults: add expand_user_and_vars flag to write (#5243) (#5260)

* Add expand_user_and_vars flag to write

Closes #5234

* Add changelog

* Update changelogs/fragments/5243-osx-defaults-expand-user-flags.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit f929422dac)

Co-authored-by: Pavel Zwerschke <pavelzw@gmail.com>
This commit is contained in:
patchback[bot] 2022-09-10 11:18:55 +02:00 committed by GitHub
parent 21ad7c8bfa
commit bc32914424
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- osx_defaults - no longer expand ``~`` in ``value`` to the user's home directory, or expand environment variables (https://github.com/ansible-collections/community.general/issues/5234, https://github.com/ansible-collections/community.general/pull/5243).

View file

@ -304,7 +304,8 @@ class OSXDefaults(object):
if not isinstance(value, list): if not isinstance(value, list):
value = [value] value = [value]
rc, out, err = self.module.run_command(self._base_command() + ['write', self.domain, self.key, '-' + self.type] + value) rc, out, err = self.module.run_command(self._base_command() + ['write', self.domain, self.key, '-' + self.type] + value,
expand_user_and_vars=False)
if rc != 0: if rc != 0:
raise OSXDefaultsException('An error occurred while writing value to defaults: %s' % out) raise OSXDefaultsException('An error occurred while writing value to defaults: %s' % out)