Lines 222-229
if __name__ == '__main__':
|
Link Here
|
---|
|
222 |
log.write('Found %i shares and %i mountpoints\n' % (len(shares), len(mountpoints))) |
222 |
log.write('Found %i shares and %i mountpoints\n' % (len(shares), len(mountpoints))) |
223 |
for mountpoint_path, attrs in mountpoints.items(): |
223 |
for mountpoint_path, attrs in mountpoints.items(): |
224 |
if attrs['reapplyQuota']: |
224 |
if attrs['reapplyQuota']: |
225 |
log.write('Set quota on mountpoint "%s": /usr/sbin/setquota -u %s %s %s %s %s %s\n' % (mountpoint_path, user, attrs['spaceSoftLimit'], attrs['spaceHardLimit'], attrs['inodeSoftLimit'], attrs['inodeHardLimit'], mountpoint_path)) |
225 |
log.write('Set quota on mountpoint "%s": /usr/sbin/setquota --always-resolve -u %s %s %s %s %s %s\n' % (mountpoint_path, user, attrs['spaceSoftLimit'], attrs['spaceHardLimit'], attrs['inodeSoftLimit'], attrs['inodeHardLimit'], mountpoint_path)) |
226 |
command = ['/usr/sbin/setquota', '-u', user, str(attrs['spaceSoftLimit']), str(attrs['spaceHardLimit']), str(attrs['inodeSoftLimit']), str(attrs['inodeHardLimit']), mountpoint_path] |
226 |
command = ['/usr/sbin/setquota', '--always-resolve', '-u', user, str(attrs['spaceSoftLimit']), str(attrs['spaceHardLimit']), str(attrs['inodeSoftLimit']), str(attrs['inodeHardLimit']), mountpoint_path] |
227 |
set_quota = subprocess.Popen(command, stderr=log) |
227 |
set_quota = subprocess.Popen(command, stderr=log) |
228 |
set_quota.wait() |
228 |
set_quota.wait() |
229 |
else: |
229 |
else: |