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

Proposed by Andres Rodriguez
Status: Rejected
Rejected by: MAAS Lander
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
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

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
=== modified file 'src/provisioningserver/refresh/node_info_scripts.py'
--- src/provisioningserver/refresh/node_info_scripts.py 2017-02-27 14:19:44 +0000
+++ src/provisioningserver/refresh/node_info_scripts.py 2017-02-28 15:12:29 +0000
@@ -359,11 +359,17 @@
359359
360 def _path_to_idpath(path):360 def _path_to_idpath(path):
361 """Searches dev_disk_byid for a device symlinked to /dev/[path]"""361 """Searches dev_disk_byid for a device symlinked to /dev/[path]"""
362 shortest = None
362 if os.path.exists(dev_disk_byid):363 if os.path.exists(dev_disk_byid):
363 for link in os.listdir(dev_disk_byid):364 for link in os.listdir(dev_disk_byid):
364 if os.path.exists(path) and os.path.samefile(365 if os.path.exists(path) and os.path.samefile(
365 os.path.join(dev_disk_byid, link), path):366 os.path.join(dev_disk_byid, link), path):
366 return os.path.join(dev_disk_byid, link)367 if shortest is None:
368 shortest = link
369 elif len(link) < len(shortest):
370 shortest = link
371 if shortest:
372 return os.path.join(dev_disk_byid, shortest)
367 return None373 return None
368374
369 # Grab the block devices from lsblk. Excludes RAM devices375 # Grab the block devices from lsblk. Excludes RAM devices