Lines 236-243
if __name__ == '__main__':
|
Link Here
|
---|
|
236 |
log.write('Found %i shares and %i mountpoints\n' % (len(shares), len(mountpoints))) |
236 |
log.write('Found %i shares and %i mountpoints\n' % (len(shares), len(mountpoints))) |
237 |
for mountpoint_path, attrs in mountpoints.iteritems(): |
237 |
for mountpoint_path, attrs in mountpoints.iteritems(): |
238 |
if attrs['reapplyQuota']: |
238 |
if attrs['reapplyQuota']: |
239 |
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)) |
239 |
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)) |
240 |
command = ['/usr/sbin/setquota', '-u', user, str(attrs['spaceSoftLimit']), str(attrs['spaceHardLimit']), str(attrs['inodeSoftLimit']), str(attrs['inodeHardLimit']), mountpoint_path] |
240 |
command = ['/usr/sbin/setquota', '--always-resolve', '-u', user, str(attrs['spaceSoftLimit']), str(attrs['spaceHardLimit']), str(attrs['inodeSoftLimit']), str(attrs['inodeHardLimit']), mountpoint_path] |
241 |
set_quota = subprocess.Popen(command, stderr=log) |
241 |
set_quota = subprocess.Popen(command, stderr=log) |
242 |
set_quota.wait() |
242 |
set_quota.wait() |
243 |
else: |
243 |
else: |