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

Proposed by Andres Rodriguez
Status: Rejected
Rejected by: MAAS Lander
Proposed branch: lp:~andreserl/maas/lp1665143
Merge into: lp: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
Blake Rouse (community) Needs Fixing
Review via email: mp+318490@code.launchpad.net

This proposal supersedes a proposal from 2017-02-28.

To post a comment you must log in.
Revision history for this message
Blake Rouse (blake-rouse) wrote :

Tests? Commit message?

review: Needs Fixing
Revision history for this message
MAAS Lander (maas-lander) wrote :

Transitioned to Git.

lp:maas has now moved from Bzr to Git.
Please propose your branches with Launchpad using Git.

git clone https://git.launchpad.net/maas

Unmerged revisions

5758. By Andres Rodriguez on 2017-02-27

Make updates

5757. By Andres Rodriguez on 2017-02-27

Make updates

5756. By Andres Rodriguez on 2017-02-22

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-28 15:12:29 +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