Author: s0undt3ch
Revision: 6070
Log:
The !FreeSpace plugin only calculates free-space on existing
directories. Cleaned-up logging.
Diff:
Modified: trunk/deluge/plugins/freespace/freespace/core.py
===================================================================
--- trunk/deluge/plugins/freespace/freespace/core.py 2010-01-01 21:27:13 UTC
(rev 6069)
+++ trunk/deluge/plugins/freespace/freespace/core.py 2010-01-01 21:44:55 UTC
(rev 6070)
@@ -113,18 +113,20 @@
self._cleanup.stop()
def update(self):
- log.debug('\n\nUpdating %s FreeSpace', self.__class__.__name__)
+ log.debug('Updating %s FreeSpace', self.__class__.__name__)
nots = {}
for path in self.__gather_paths_to_check():
log.debug("Checking path %s", path)
- free_percent = self.__get_free_space(path)
- if (100 - free_percent) > self.config['percent']:
- if path not in self.notifications_sent:
- self.notifications_sent[path] = datetime.utcnow()
- nots[path] = (100 - free_percent)
- else:
- log.warning("Running low on disk space on %s but "
- "notifications were already triggered.", path)
+ if os.path.exists(path):
+ free_percent = self.__get_free_space(path)
+ if (100 - free_percent) > self.config['percent']:
+ if path not in self.notifications_sent:
+ self.notifications_sent[path] = datetime.utcnow()
+ nots[path] = (100 - free_percent)
+ else:
+ log.warning("Running low on disk space on %s but "
+ "notifications were already triggered.",
+ path)
if nots:
component.get("EventManager").emit(LowDiskSpaceEvent(nots))
--
You received this message because you are subscribed to the Google Groups
"deluge-commit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/deluge-commit?hl=en.