kkpyutil 1.49.1__tar.gz → 1.49.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: kkpyutil
3
- Version: 1.49.1
3
+ Version: 1.49.2
4
4
  Summary: Building blocks for sysadmin and DevOps
5
5
  Home-page: https://github.com/kakyoism/kkpyutil/
6
6
  License: MIT
@@ -2148,6 +2148,13 @@ def sync_dirs(src_root, dst_root, logger=glogger, sudo=False):
2148
2148
  if not _run_sudo_command(cmd, pwd, logger):
2149
2149
  logger.error(f'Sync failed with command: {cmd}; you may have entered wrong password')
2150
2150
  return False
2151
+ # 3. Step Two: Fix Ownership
2152
+ # -R is recursive. We set it to the user and the 'staff' group.
2153
+ chown_cmd = ['chown', '-R', f'{user}:staff', dst_root]
2154
+ logger.info(f"Setting ownership of {dst_root} to {user}...")
2155
+ if not _run_sudo_command(chown_cmd, pwd, logger):
2156
+ logger.error("Failed to set ownership.")
2157
+ return False
2151
2158
  return True
2152
2159
 
2153
2160
 
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "kkpyutil"
3
- version = "1.49.1"
3
+ version = "1.49.2"
4
4
  description = "Building blocks for sysadmin and DevOps"
5
5
  authors = ["Beinan Li <li.beinan@gmail.com>"]
6
6
  maintainers = ["Beinan Li <li.beinan@gmail.com>"]
File without changes
File without changes