Merge lp:~andreserl/maas/lp1665143 into lp:~maas-committers/maas/trunk

Proposed by Andres Rodriguez
Status: Superseded
Proposed branch: lp:~andreserl/maas/lp1665143
Merge into: lp:~maas-committers/maas/trunk
Diff against target: 22 lines (+7/-1)
1 file modified
src/provisioningserver/refresh/node_info_scripts.py (+7/-1)
To merge this branch: bzr merge lp:~andreserl/maas/lp1665143
Reviewer Review Type Date Requested Status
MAAS Maintainers Pending
Review via email: mp+318409@code.launchpad.net

This proposal has been superseded by a proposal from 2017-02-28.

To post a comment you must log in.
lp:~andreserl/maas/lp1665143 updated
5758. By Andres Rodriguez

Make updates

Unmerged revisions

5758. By Andres Rodriguez

Make updates

5757. By Andres Rodriguez

Make updates

5756. By Andres Rodriguez

Work around issue when discovering nvme

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/provisioningserver/refresh/node_info_scripts.py'
2--- src/provisioningserver/refresh/node_info_scripts.py 2017-02-27 14:19:44 +0000
3+++ src/provisioningserver/refresh/node_info_scripts.py 2017-02-27 21:08:38 +0000
4@@ -359,11 +359,17 @@
5
6 def _path_to_idpath(path):
7 """Searches dev_disk_byid for a device symlinked to /dev/[path]"""
8+ shortest = None
9 if os.path.exists(dev_disk_byid):
10 for link in os.listdir(dev_disk_byid):
11 if os.path.exists(path) and os.path.samefile(
12 os.path.join(dev_disk_byid, link), path):
13- return os.path.join(dev_disk_byid, link)
14+ if shortest is None:
15+ shortest = link
16+ elif len(link) < len(shortest):
17+ shortest = link
18+ if shortest:
19+ return os.path.join(dev_disk_byid, shortest)
20 return None
21
22 # Grab the block devices from lsblk. Excludes RAM devices