[node-patches] Change in ovirt-node[master]: Support specify cdrom dev name in boot params
boh.ricky at gmail.com
boh.ricky at gmail.com
Thu Jul 11 16:27:30 UTC 2013
hai bo has uploaded a new change for review.
Change subject: Support specify cdrom dev name in boot params
......................................................................
Support specify cdrom dev name in boot params
Now ovirt-node only support specify cdrom by cdlabel.
This patch support specify cdrom dev name ,like: /dev/sr0
Change-Id: Iad56b197b3130b3378638eeca1d61e001cd13c5b
Signed-off-by: boh.ricky <boh.ricky at gmail.com>
---
M src/ovirtnode/ovirtfunctions.py
1 file changed, 7 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/49/16749/1
diff --git a/src/ovirtnode/ovirtfunctions.py b/src/ovirtnode/ovirtfunctions.py
index 33d64c8..e68b7c5 100644
--- a/src/ovirtnode/ovirtfunctions.py
+++ b/src/ovirtnode/ovirtfunctions.py
@@ -451,8 +451,13 @@
# dev_live if not exist alternative
client = gudev.Client(['block'])
cmdline = open("/proc/cmdline")
- cdlabel = re.search('CDLABEL\=([a-zA-Z0-9_\.-]+)', cmdline.read())
- cdlabel = cdlabel.group(0).split("=")[1]
+ cmdline_data = cmdline.read()
+ cdlabel = re.search('CDLABEL\=([a-zA-Z0-9_\.-]+)',cmdline_data)
+ if cdlabel is None:
+ cdlabel = re.search('live\:([a-zA-Z0-9_\.-\/]+)',cmdline_data)
+ live_dev = cdlabel.group(0).split(":")[1]
+ else:
+ cdlabel = cdlabel.group(0).split("=")[1]
cmdline.close()
for device in client.query_by_subsystem("block"):
if device.has_property("ID_CDROM"):
--
To view, visit http://gerrit.ovirt.org/16749
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iad56b197b3130b3378638eeca1d61e001cd13c5b
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: hai bo <boh.ricky at gmail.com>
More information about the node-patches
mailing list