Merge ~ack/maas:1988759-vmhost-deploy-3.2 into maas:3.2

Proposed by Alberto Donato
Status: Merged
Merge reported by: MAAS Lander
Merged at revision: not available
Proposed branch: ~ack/maas:1988759-vmhost-deploy-3.2
Merge into: maas:3.2
Diff against target: 53 lines (+6/-6)
3 files modified
src/metadataserver/tests/test_vendor_data.py (+1/-1)
src/metadataserver/vendor_data.py (+1/-1)
src/provisioningserver/drivers/pod/lxd.py (+4/-4)
Reviewer Review Type Date Requested Status
MAAS Lander Needs Fixing
Alberto Donato (community) Approve
Review via email: mp+431584@code.launchpad.net

Commit message

LP:1988759 don't restrict LXD credentials to the maas project on LXD deploy

This causes MAAS not to be able to read storage volumes and networks from LXD

(backport of 95c09efaf)

To post a comment you must log in.
Revision history for this message
Alberto Donato (ack) :
review: Approve
Revision history for this message
MAAS Lander (maas-lander) wrote :

UNIT TESTS
-b 1988759-vmhost-deploy-3.2 lp:~ack/maas/+git/maas into -b 3.2 lp:~maas-committers/maas

STATUS: FAILED
LOG: http://maas-ci.internal:8080/job/maas-tester/1039/consoleText
COMMIT: a0449358cfa6dd7e6772f26a6e9cfe0b377ccbdc

review: Needs Fixing

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/src/metadataserver/tests/test_vendor_data.py b/src/metadataserver/tests/test_vendor_data.py
index 74aed9e..54e3fd7 100644
--- a/src/metadataserver/tests/test_vendor_data.py
+++ b/src/metadataserver/tests/test_vendor_data.py
@@ -450,7 +450,7 @@ class TestGenerateKVMPodConfiguration(MAASServerTestCase):
450 "lxd init --auto --network-address=[::]",450 "lxd init --auto --network-address=[::]",
451 "lxc project create maas",451 "lxc project create maas",
452 "sh -c 'lxc project edit maas </root/maas-project.yaml'",452 "sh -c 'lxc project edit maas </root/maas-project.yaml'",
453 "lxc config trust add /root/lxd.crt --restricted --projects maas",453 "lxc config trust add /root/lxd.crt",
454 "rm /root/lxd.crt /root/maas-project.yaml",454 "rm /root/lxd.crt /root/maas-project.yaml",
455 ],455 ],
456 ),456 ),
diff --git a/src/metadataserver/vendor_data.py b/src/metadataserver/vendor_data.py
index 1e69157..60b27f5 100644
--- a/src/metadataserver/vendor_data.py
+++ b/src/metadataserver/vendor_data.py
@@ -232,7 +232,7 @@ def generate_kvm_pod_configuration(node):
232 "lxd init --auto --network-address=[::]",232 "lxd init --auto --network-address=[::]",
233 f"lxc project create {maas_project}",233 f"lxc project create {maas_project}",
234 f"sh -c 'lxc project edit {maas_project} <{project_conf_file}'",234 f"sh -c 'lxc project edit {maas_project} <{project_conf_file}'",
235 f"lxc config trust add {cert_file} --restricted --projects {maas_project}",235 f"lxc config trust add {cert_file}",
236 f"rm {cert_file} {project_conf_file}",236 f"rm {cert_file} {project_conf_file}",
237 ]237 ]
238238
diff --git a/src/provisioningserver/drivers/pod/lxd.py b/src/provisioningserver/drivers/pod/lxd.py
index 0265d4f..4131b8c 100644
--- a/src/provisioningserver/drivers/pod/lxd.py
+++ b/src/provisioningserver/drivers/pod/lxd.py
@@ -876,7 +876,7 @@ class LXDPodDriver(PodDriver):
876 try:876 try:
877 client.authenticate(password)877 client.authenticate(password)
878 except LXDAPIException as e:878 except LXDAPIException as e:
879 raise Error(f"Password authentication failed: {e}")879 raise Error(f"Password authentication failed: {e}") from e
880 return client880 return client
881881
882 try:882 try:
@@ -899,10 +899,10 @@ class LXDPodDriver(PodDriver):
899 raise Error(899 raise Error(
900 "Certificate is not trusted and no password was given"900 "Certificate is not trusted and no password was given"
901 )901 )
902 except ClientConnectionFailed:902 except ClientConnectionFailed as e:
903 raise LXDPodError(903 raise LXDPodError(
904 f"Pod {pod_id}: Failed to connect to the LXD REST API."904 f"Pod {pod_id}: Failed to connect to the LXD REST API: {e}"
905 )905 ) from e
906 else:906 else:
907 yield client907 yield client
908 finally:908 finally:

Subscribers

People subscribed via source and target branches