Skip to content

Commit

Permalink
Make use of shadow utils conditional on config
Browse files Browse the repository at this point in the history
  • Loading branch information
mhjacks committed Jan 10, 2024
1 parent a7e9964 commit 8ba26d7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion mock/py/mockbuild/shadow_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ def _execute_command(self, command, can_fail=False):
with self.root.uid_manager.elevated_privileges():
# Execute the command in bootstrap, since host configuration may not permit
# ordinary user addition, such as would happen with freeipa-provided subids
do_with_status(command, chrootPath=self.chroot_dir, raiseExc=not can_fail)
if ('use_chroot_shadow_utils' in self.root.config) and self.root.config['use_chroot_shadow_utils']:
do_with_status(command, chrootPath=self.chroot_dir, raiseExc=not can_fail)
else:
do_with_status(command + ['--prefix', self.chroot_dir], raiseExc=not can_fail)


def delete_user(self, username, can_fail=False):
"""
Expand Down

0 comments on commit 8ba26d7

Please sign in to comment.