[node-patches] Change in ovirt-node[ovirt-3.5]: Additional input parameter check to persist and unpersist fu...

fabiand at redhat.com fabiand at redhat.com
Wed Dec 3 16:18:51 UTC 2014


Hello Anatoly Litovsky,

I'd like you to do a code review.  Please visit

    http://gerrit.ovirt.org/35853

to review the following change.

Change subject: Additional input parameter check to persist and unpersist function in fs utils.
......................................................................

Additional input parameter check to persist and unpersist function in fs
utils.

Passing None as path will no longer cause for a crash.

Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1154356
Change-Id: Icd6a0010e4ffdfd92b83506f1809ff54f5f40e10
Signed-off-by: Tolik Litovsky <tlitovsk at redhat.com>
---
M src/ovirt/node/utils/fs/__init__.py
1 file changed, 8 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/53/35853/1

diff --git a/src/ovirt/node/utils/fs/__init__.py b/src/ovirt/node/utils/fs/__init__.py
index d03a1b3..965aac2 100644
--- a/src/ovirt/node/utils/fs/__init__.py
+++ b/src/ovirt/node/utils/fs/__init__.py
@@ -411,6 +411,10 @@
         # TODO: Abort if it is stateless
         if not self.is_enabled():
             return
+
+        if path is None:
+            return
+
         abspath = os.path.abspath(path)
         if os.path.exists(abspath):
             # Check first for symlinks as os.path file type detection follows
@@ -557,6 +561,10 @@
         """
         if not self.is_enabled():
             return
+
+        if path is None:
+            return
+
         abspath = os.path.abspath(path)
         if os.path.exists(abspath):
             # Check first for symlinks as os.path file type detection follows


-- 
To view, visit http://gerrit.ovirt.org/35853
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icd6a0010e4ffdfd92b83506f1809ff54f5f40e10
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: ovirt-3.5
Gerrit-Owner: Fabian Deutsch <fabiand at redhat.com>
Gerrit-Reviewer: Anatoly Litovsky <tlitovsk at redhat.com>
Gerrit-Reviewer: Fabian Deutsch <fabiand at redhat.com>



More information about the node-patches mailing list