Merge ~mfo/maas:lp2007297-3.2 into maas:3.2

Proposed by Mauricio Faria de Oliveira
Status: Needs review
Proposed branch: ~mfo/maas:lp2007297-3.2
Merge into: maas:3.2
Diff against target: 71 lines (+17/-0)
3 files modified
src/provisioningserver/drivers/pod/lxd.py (+2/-0)
src/provisioningserver/drivers/pod/tests/test_lxd.py (+14/-0)
utilities/check-imports (+1/-0)
Reviewer Review Type Date Requested Status
MAAS Lander Needs Fixing
Mauricio Faria de Oliveira Pending
Review via email: mp+466143@code.launchpad.net

Commit message

[3.2] LP:2007297 Set pylxd session to not trust the environment

(cherry picked from commit 58e3a2328dd308056170b3af3921ed1842a08a8f)
Signed-off-by: Mauricio Faria de Oliveira <email address hidden>

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

UNIT TESTS
-b lp2007297-3.2 lp:~mfo/maas/+git/maas into -b 3.2 lp:~maas-committers/maas

STATUS: FAILED
LOG: http://maas-ci.internal:8080/job/maas-tester/5565/console
COMMIT: cee1a302b38068dbc02a862c9bee5cbc15dadfd7

review: Needs Fixing
Revision history for this message
Mauricio Faria de Oliveira (mfo) wrote :

jenkins: !test

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

UNIT TESTS
-b lp2007297-3.2 lp:~mfo/maas/+git/maas into -b 3.2 lp:~maas-committers/maas

STATUS: FAILED
LOG: http://maas-ci.internal:8080/job/maas-tester/5568/console
COMMIT: cee1a302b38068dbc02a862c9bee5cbc15dadfd7

review: Needs Fixing
Revision history for this message
Mauricio Faria de Oliveira (mfo) wrote :

jenkins: !test

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

UNIT TESTS
-b lp2007297-3.2 lp:~mfo/maas/+git/maas into -b 3.2 lp:~maas-committers/maas

STATUS: FAILED
LOG: http://maas-ci.internal:8080/job/maas-tester/5569/console
COMMIT: cee1a302b38068dbc02a862c9bee5cbc15dadfd7

review: Needs Fixing
Revision history for this message
Mauricio Faria de Oliveira (mfo) wrote :

jenkins: !test

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

UNIT TESTS
-b lp2007297-3.2 lp:~mfo/maas/+git/maas into -b 3.2 lp:~maas-committers/maas

STATUS: FAILED
LOG: http://maas-ci.internal:8080/job/maas-tester/5570/console
COMMIT: cee1a302b38068dbc02a862c9bee5cbc15dadfd7

review: Needs Fixing
Revision history for this message
Mauricio Faria de Oliveira (mfo) wrote :

Some unit tests seem to be consistently failing.

Testing a revert in MR [1].

[1] https://code.launchpad.net/~mfo/maas/+git/maas/+merge/466174

Revision history for this message
Seyeong Kim (seyeongkim) wrote :

I guess somehow maas region or rack daemon stopped. and timed out. maybe not enough memory? i'm not sure about CI though...

I had a discussion with solutionsQA and they also faced the issue. so I checked this briefly.

Revision history for this message
Seyeong Kim (seyeongkim) wrote :

jenkins: !test

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

UNIT TESTS
-b lp2007297-3.2 lp:~mfo/maas/+git/maas into -b 3.2 lp:~maas-committers/maas

STATUS: FAILED
LOG: http://maas-ci.internal:8080/job/maas-tester/5691/console
COMMIT: cee1a302b38068dbc02a862c9bee5cbc15dadfd7

review: Needs Fixing
Revision history for this message
Seyeong Kim (seyeongkim) wrote :

when I try to test maas 3.2 in my local I face this issue

TypeError: can only concatenate list (not "tuple") to list

and fix

https://github.com/canonical/maas/commit/215bff0f8d3136db61208f2de5856364c9cea0e4

Unmerged commits

cee1a30... by Adam Collard

[3.2] LP:2007297 Set pylxd session to not trust the environment

(cherry picked from commit 58e3a2328dd308056170b3af3921ed1842a08a8f)
Signed-off-by: Mauricio Faria de Oliveira <email address hidden>

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/src/provisioningserver/drivers/pod/lxd.py b/src/provisioningserver/drivers/pod/lxd.py
index f5ca215..af51304 100644
--- a/src/provisioningserver/drivers/pod/lxd.py
+++ b/src/provisioningserver/drivers/pod/lxd.py
@@ -872,6 +872,8 @@ class LXDPodDriver(PodDriver):
872 cert=cert,872 cert=cert,
873 verify=False,873 verify=False,
874 )874 )
875 # Don't inherit proxy environment variables
876 client.api.session.trust_env = False
875 if not client.trusted and password:877 if not client.trusted and password:
876 try:878 try:
877 client.authenticate(password)879 client.authenticate(password)
diff --git a/src/provisioningserver/drivers/pod/tests/test_lxd.py b/src/provisioningserver/drivers/pod/tests/test_lxd.py
index 1140f26..e5b5b13 100644
--- a/src/provisioningserver/drivers/pod/tests/test_lxd.py
+++ b/src/provisioningserver/drivers/pod/tests/test_lxd.py
@@ -12,6 +12,7 @@ from unittest.mock import ANY, MagicMock, Mock, PropertyMock, sentinel
1212
13from fixtures import EnvironmentVariable, TempDir13from fixtures import EnvironmentVariable, TempDir
14from pylxd.exceptions import ClientConnectionFailed, LXDAPIException, NotFound14from pylxd.exceptions import ClientConnectionFailed, LXDAPIException, NotFound
15from requests import Session
15from testtools.testcase import ExpectedException16from testtools.testcase import ExpectedException
16from twisted.internet.defer import inlineCallbacks17from twisted.internet.defer import inlineCallbacks
1718
@@ -142,6 +143,7 @@ class FakeClient:
142 self.trusted = False143 self.trusted = False
143 self._fail_auth = False144 self._fail_auth = False
144 self.host_info = self.fake_lxd.host_info145 self.host_info = self.fake_lxd.host_info
146 self.api = FakeAPINode()
145147
146 def authenticate(self, password):148 def authenticate(self, password):
147 if self._fail_auth:149 if self._fail_auth:
@@ -155,6 +157,13 @@ class FakeClient:
155 raise AttributeError(name)157 raise AttributeError(name)
156158
157159
160class FakeAPINode:
161 """A fake pylxd.client._APINode"""
162
163 def __init__(self):
164 self.session = Session()
165
166
158class FakeLXD:167class FakeLXD:
159 """A fake LXD server."""168 """A fake LXD server."""
160169
@@ -463,6 +472,11 @@ class TestLXDPodDriver(MAASTestCase):
463 self.assertIsInstance(client.cert, tuple)472 self.assertIsInstance(client.cert, tuple)
464 self.assertFalse(client.verify)473 self.assertFalse(client.verify)
465474
475 def test_get_client_should_not_trust_environment(self):
476 context = self.make_context()
477 with self.driver._get_client(None, context) as client:
478 self.assertFalse(client.api.session.trust_env)
479
466 def test_get_client_no_certificates_no_password(self):480 def test_get_client_no_certificates_no_password(self):
467 context = self.make_context(with_cert=False, with_password=False)481 context = self.make_context(with_cert=False, with_password=False)
468 pod_id = factory.make_name("pod_id")482 pod_id = factory.make_name("pod_id")
diff --git a/utilities/check-imports b/utilities/check-imports
index 153edb3..e56942c 100755
--- a/utilities/check-imports
+++ b/utilities/check-imports
@@ -436,6 +436,7 @@ checks = [
436 RackControllerRule436 RackControllerRule
437 | Rule(437 | Rule(
438 Allow("apiclient.testing.credentials.make_api_credentials"),438 Allow("apiclient.testing.credentials.make_api_credentials"),
439 Allow("requests|requests.**"),
439 Allow(StandardLibraries),440 Allow(StandardLibraries),
440 Allow(TestingLibraries),441 Allow(TestingLibraries),
441 ),442 ),

Subscribers

People subscribed via source and target branches