mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Fix disk.usage beacon on Windows
As documented the drive should be designated as C:\\. A recent PR 50188 changed the behavior to work with C:\, which was causing the documented syntax to fail. This change allows either syntax C:\ or C:\\
This commit is contained in:
parent
c1ab63dd45
commit
48ae8c63bd
1 changed files with 5 additions and 1 deletions
|
@ -97,7 +97,11 @@ def beacon(config):
|
|||
mount_re = '{0}$'.format(mount)
|
||||
|
||||
if salt.utils.platform.is_windows():
|
||||
mount_re = re.sub('\\$', '\\\\', mount_re)
|
||||
# mount_re comes in formatted with a $ at the end
|
||||
# can be `C:\\$` or `C:\\\\$`
|
||||
# re string must be like `C:\\\\` regardless of \\ or \\\\
|
||||
mount_re = re.sub(r':\\\$', r':\\\\', mount_re)
|
||||
mount_re = re.sub(r':\\\\\$', r':\\\\', mount_re)
|
||||
|
||||
for part in parts:
|
||||
if re.match(mount_re, part.mountpoint):
|
||||
|
|
Loading…
Add table
Reference in a new issue