|
6 | 6 | import json |
7 | 7 | import logging |
8 | 8 | import os |
| 9 | +import stat |
9 | 10 | import platform |
10 | 11 | import re |
11 | 12 | import shutil |
@@ -569,6 +570,7 @@ def saveStatusFile(self): |
569 | 570 | statusFilepath = self.getStatusFile() |
570 | 571 | folder = os.path.dirname(statusFilepath) |
571 | 572 | os.makedirs(folder, exist_ok=True) |
| 573 | + os.chmod(folder, os.stat(folder).st_mode | stat.S_ISGID) # Add setgid on folder |
572 | 574 |
|
573 | 575 | statusFilepathWriting = getWritingFilepath(statusFilepath) |
574 | 576 | with open(statusFilepathWriting, 'w') as jsonFile: |
@@ -611,6 +613,7 @@ def saveStatistics(self): |
611 | 613 | statisticsFilepath = self.getStatisticsFile() |
612 | 614 | folder = os.path.dirname(statisticsFilepath) |
613 | 615 | os.makedirs(folder, exist_ok=True) |
| 616 | + os.chmod(folder, os.stat(folder).st_mode | stat.S_ISGID) # Add setgid on folder |
614 | 617 | statisticsFilepathWriting = getWritingFilepath(statisticsFilepath) |
615 | 618 | with open(statisticsFilepathWriting, 'w') as jsonFile: |
616 | 619 | json.dump(data, jsonFile, indent=4) |
@@ -1650,6 +1653,7 @@ def upgradeStatusFile(self): |
1650 | 1653 | statusFilepath = self.nodeStatusFile |
1651 | 1654 | folder = os.path.dirname(statusFilepath) |
1652 | 1655 | os.makedirs(folder, exist_ok=True) |
| 1656 | + os.chmod(folder, os.stat(folder).st_mode | stat.S_ISGID) # Add setgid on folder |
1653 | 1657 | statusFilepathWriting = getWritingFilepath(statusFilepath) |
1654 | 1658 | with open(statusFilepathWriting, 'w') as jsonFile: |
1655 | 1659 | json.dump(data, jsonFile, indent=4) |
|
0 commit comments