← Back to team overview

sts-sponsors team mailing list archive

[Merge] ~adam-collard/maas:machine-resources-path into maas:master

 

Adam Collard has proposed merging ~adam-collard/maas:machine-resources-path into maas:master.

Commit message:
fix: path to machine-resources after host-info refactor

Add assert for existence of the path



Requested reviews:
  MAAS Maintainers (maas-maintainers)

For more details, see:
https://code.launchpad.net/~adam-collard/maas/+git/maas/+merge/435462
-- 
Your team MAAS Committers is subscribed to branch maas:master.
diff --git a/src/provisioningserver/utils/ipaddr.py b/src/provisioningserver/utils/ipaddr.py
index 885907e..c686138 100644
--- a/src/provisioningserver/utils/ipaddr.py
+++ b/src/provisioningserver/utils/ipaddr.py
@@ -174,8 +174,11 @@ def _parse_proc_net_bonding(path):
 def _get_resources_bin_path():
     """Return the path of the resources binary."""
     if is_dev_environment():
-        path = "src/machine-resources/bin"
+        path = "src/host-info/bin/machine-resources"
     else:
         prefix = SnapPaths.from_environ().snap or ""
         path = f"{prefix}/usr/share/maas/machine-resources"
+    assert os.path.exists(
+        path
+    ), f"Failed to find directory for machine-resources, expected at {path}"
     return os.path.join(path, get_architecture())

Follow ups