- print >>f, "{0}:x:{1}:{2}".format(groupgrp.gr_name, groupgrp.gr_gid, name)
-
+ print("{0}:x:{1}:{2}".format(groupgrp.gr_name, groupgrp.gr_gid, name), file=f)
+
+ # Make sure ~/data (part of the fstab above) exists.
+ if not os.path.exists(data):
+ os.mkdir(data)
+ shutil.chown(data, name, name)
+ os.chmod(data, 0o640)
+