[node-patches] Change in ovirt-node[ovirt-3.5]: Make sure $live_dev isn't an empty string

fabiand at redhat.com fabiand at redhat.com
Wed Nov 26 11:32:21 UTC 2014


Hello Ryan Barry,

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

    http://gerrit.ovirt.org/35593

to review the following change.

Change subject: Make sure $live_dev isn't an empty string
......................................................................

Make sure $live_dev isn't an empty string

Checking whether an empty string exists as a file appears to
always be true. Check whether it's empty as well, so we don't try
to use empty strings as $live_dev

Change-Id: I9e118e32d716e9e904cd399d3b77dc1b55c9581c
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1163688
Signed-off-by: Ryan Barry <rbarry at redhat.com>
---
M dracut/ovirt-boot-functions
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/93/35593/1

diff --git a/dracut/ovirt-boot-functions b/dracut/ovirt-boot-functions
index 780c275..26ef702 100644
--- a/dracut/ovirt-boot-functions
+++ b/dracut/ovirt-boot-functions
@@ -25,7 +25,7 @@
 # livecd boot disk
 get_live_disk() {
     local live_dev=$(grep /dev/.initramfs/live /proc/mounts | awk '{print $1}')
-    if [ ! -e $live_dev ]; then
+    if [ -z $live_dev ] || [ ! -e $live_dev ]; then
       # PXE boot
       live_dev=/dev/loop0
       live_disk=


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9e118e32d716e9e904cd399d3b77dc1b55c9581c
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: ovirt-3.5
Gerrit-Owner: Fabian Deutsch <fabiand at redhat.com>
Gerrit-Reviewer: Fabian Deutsch <fabiand at redhat.com>
Gerrit-Reviewer: Ryan Barry <rbarry at redhat.com>



More information about the node-patches mailing list