summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSiddharth Ravikumar <sravik@bgsu.edu>2015-12-21 20:29:15 -0500
committerSiddharth Ravikumar <sravik@bgsu.edu>2015-12-21 20:29:15 -0500
commit6c45b36e0e2923422fe9e116f517a3af7ecb4b37 (patch)
tree1ec2d6cb3321a2ba0b52f93c3157e17c336b2194
parentc348c16a6659f961d17046ddf3351208b7fcb5f7 (diff)
Now use `os.renames` instead `os.rename` function.
-rw-r--r--ChangeLog9
-rw-r--r--combox/events.py2
-rw-r--r--combox/file.py4
3 files changed, 12 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 65cf4ae..29e2f6a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
2015-12-21 Siddharth Ravikumar <sravik@bgsu.edu>
+ * combox/events.py (NodeDirMonitor.on_moved): Now uses
+ `os.renames` function instead `os.rename` to create intermediate
+ directories if they're non-existent.
+ * combox/file.py (move_nodedir, move_shards): Now uses
+ `os.renames` function instead `os.rename` to create intermediate
+ directories if they're non-existent.
+
+2015-12-21 Siddharth Ravikumar <sravik@bgsu.edu>
+
commit 8c86e7c28738c66c0e04ae7886b44dbcdfc6369e
* combox/events.py (ComboxDirMonitor.on_modified)
diff --git a/combox/events.py b/combox/events.py
index be37337..fa238ee 100644
--- a/combox/events.py
+++ b/combox/events.py
@@ -506,7 +506,7 @@ class NodeDirMonitor(LoggingEventHandler):
return
else:
try:
- os.rename(src_cb_path, dest_cb_path)
+ os.renames(src_cb_path, dest_cb_path)
except OSError, e:
log_e("Jeez, failed to rename path. %r" % e)
self.silo.node_rem(silo_node_dict, src_cb_path)
diff --git a/combox/file.py b/combox/file.py
index b02c1ab..2f65e05 100644
--- a/combox/file.py
+++ b/combox/file.py
@@ -200,7 +200,7 @@ def move_nodedir(src, dest, config):
src_dir_path = path.join(node, src_rel_path)
dest_dir_path = path.join(node, dest_rel_path)
try:
- os.rename(src_dir_path, dest_dir_path)
+ os.renames(src_dir_path, dest_dir_path)
except OSError, e:
log_e("Error when trying to rename %s -> %s" % (src_dir_path, dest_dir_path))
@@ -267,7 +267,7 @@ def move_shards(src, dest, config):
dest_shard = "%s.shard%s" % (path.join(node, dest_rel_path),
shard_no)
try:
- os.rename(src_shard, dest_shard)
+ os.renames(src_shard, dest_shard)
except OSError, e:
log_e("Error when trying to rename shard %s -> %s" % (src_shard, dest_shard))