summaryrefslogtreecommitdiff
path: root/ironic_python_agent/utils.py
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2015-03-17 02:50:47 +0000
committerGerrit Code Review <review@openstack.org>2015-03-17 02:50:47 +0000
commitbe44ac8d4d1793b86ade6eef6f3b0f620779fc7e (patch)
tree169e4004855d9bc3f87f6a50fcc5f242fff2b695 /ironic_python_agent/utils.py
parent4f2ad2104ef5e972ac4c36c296cfed776504eab3 (diff)
parentd0d319d65fd7343f2b9142ca9e92876a13dd583d (diff)
downloadironic-python-agent-be44ac8d4d1793b86ade6eef6f3b0f620779fc7e.tar.gz
Merge "Use labels for virtual media dev in agent ramdisk"
Diffstat (limited to 'ironic_python_agent/utils.py')
-rw-r--r--ironic_python_agent/utils.py17
1 files changed, 12 insertions, 5 deletions
diff --git a/ironic_python_agent/utils.py b/ironic_python_agent/utils.py
index 9226c544..cddb33c0 100644
--- a/ironic_python_agent/utils.py
+++ b/ironic_python_agent/utils.py
@@ -112,12 +112,19 @@ def _get_vmedia_params():
vmedia_mount_point = "/vmedia_mnt"
parameters_file = "parameters.txt"
- vmedia_device = _get_vmedia_device()
- if not vmedia_device:
- msg = "Unable to find virtual media device"
- raise errors.VirtualMediaBootError(msg)
+ vmedia_device_file = "/dev/disk/by-label/ir-vfd-dev"
+ if not os.path.exists(vmedia_device_file):
+
+ # TODO(rameshg87): This block of code is there only for compatibility
+ # reasons (so that newer agent can work with older Ironic). Remove
+ # this after Liberty release.
+ vmedia_device = _get_vmedia_device()
+ if not vmedia_device:
+ msg = "Unable to find virtual media device"
+ raise errors.VirtualMediaBootError(msg)
+
+ vmedia_device_file = os.path.join("/dev", vmedia_device)
- vmedia_device_file = os.path.join("/dev", vmedia_device)
os.mkdir(vmedia_mount_point)
try: