summaryrefslogtreecommitdiffstats
path: root/src/vsession.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/vsession.cpp')
-rw-r--r--src/vsession.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/vsession.cpp b/src/vsession.cpp
index 4d48326..e9059f2 100644
--- a/src/vsession.cpp
+++ b/src/vsession.cpp
@@ -110,13 +110,13 @@ bool VSession::isActive() const {
if (fromDate.isValid() && fromDate > today) {
// fromDate is in the future
- if (debugMode) qDebug() << "ERR: fromDate is in the future";
+ if (debugMode) qDebug() << "Not active. Reason: fromDate is in the future";
return false;
}
if (tillDate.isValid() && tillDate < today) {
// tillDate is in the past
- if (debugMode) qDebug() << "ERR: tillDate is in the past";
+ if (debugMode) qDebug() << "Not active. Reason: tillDate is in the past";
return false;
}
}
@@ -125,7 +125,7 @@ bool VSession::isActive() const {
QStringList pools = getAttribute("pools").split("\\s*,\\s*");
if (!pools.isEmpty() && !pools.contains(pool)) {
// pools does not contain pool
- if (debugMode) qDebug() << "ERR: pools does not contain pool";
+ if (debugMode) qDebug() << "Not active. Reason: vsession is not part of active env";
return false;
}
}
@@ -362,8 +362,19 @@ QList<Session*> VSession::readXmlDir(const QString& path) {
QDirIterator::FollowSymlinks);
while (di.hasNext()) {
if (!di.next().endsWith(".xml")) continue;
+
+ if (!di.fileInfo().isReadable()) {
+ if (debugMode) qDebug() << "skip" << di.fileInfo().absoluteFilePath() << ": xml not readable, incorrect file permissions";
+ continue;
+ }
+
QList<Session*> vsessionTmp = readXmlFile(di.fileInfo().absoluteFilePath());
+ if (vsessionTmp.isEmpty()) {
+ if (debugMode) qDebug() << "skip" << di.fileInfo().absoluteFilePath() << ": reading xml failed for some reason";
+ continue;
+ }
+
if (!vsessionTmp.first()->isValid()) {
if (debugMode) qDebug() << "skip" << vsessionTmp.first()->shortDescription() << ": vdi/vmdk missing";
continue;