launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #14431
[Merge] lp:~rvb/maas/proxy-bug-1081229 into lp:maas
Raphaël Badin has proposed merging lp:~rvb/maas/proxy-bug-1081229 into lp:maas.
Commit message:
Add '-E' to the options when calling maas-import-pxe-files via sudo to preserve the environment.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~rvb/maas/proxy-bug-1081229/+merge/135362
This goes hand in hand with the packaging change in https://code.launchpad.net/~rvb/maas/packaging.proxy-bug-1081229/+merge/135361
--
https://code.launchpad.net/~rvb/maas/proxy-bug-1081229/+merge/135362
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~rvb/maas/proxy-bug-1081229 into lp:maas.
=== modified file 'src/maasserver/tests/test_api.py'
--- src/maasserver/tests/test_api.py 2012-11-13 18:01:08 +0000
+++ src/maasserver/tests/test_api.py 2012-11-21 10:27:37 +0000
@@ -4231,7 +4231,7 @@
httplib.OK, response.status_code,
explain_unexpected_response(httplib.OK, response))
recorder.assert_called_once_with(
- ['sudo', '-n', 'maas-import-pxe-files'], env=ANY)
+ ['sudo', '-n', '-E', 'maas-import-pxe-files'], env=ANY)
def test_nodegroup_import_boot_images_denied_if_not_admin(self):
nodegroup = factory.make_node_group()
=== modified file 'src/provisioningserver/tasks.py'
--- src/provisioningserver/tasks.py 2012-11-08 14:52:16 +0000
+++ src/provisioningserver/tasks.py 2012-11-21 10:27:37 +0000
@@ -388,4 +388,4 @@
env['PORTS_ARCHIVE'] = ports_archive
if cloud_images_archive is not None:
env['CLOUD_IMAGES_ARCHIVE'] = cloud_images_archive
- check_call(['sudo', '-n', 'maas-import-pxe-files'], env=env)
+ check_call(['sudo', '-n', '-E', 'maas-import-pxe-files'], env=env)
=== modified file 'src/provisioningserver/tests/test_tasks.py'
--- src/provisioningserver/tests/test_tasks.py 2012-11-08 14:54:02 +0000
+++ src/provisioningserver/tests/test_tasks.py 2012-11-21 10:27:37 +0000
@@ -549,14 +549,14 @@
recorder = self.patch(tasks, 'check_call', Mock())
import_boot_images()
recorder.assert_called_once_with(
- ['sudo', '-n', 'maas-import-pxe-files'], env=ANY)
+ ['sudo', '-n', '-E', 'maas-import-pxe-files'], env=ANY)
self.assertIsInstance(import_boot_images, Task)
def test_import_boot_images_preserves_environment(self):
recorder = self.patch(tasks, 'check_call', Mock())
import_boot_images()
recorder.assert_called_once_with(
- ['sudo', '-n', 'maas-import-pxe-files'], env=os.environ)
+ ['sudo', '-n', '-E', 'maas-import-pxe-files'], env=os.environ)
def test_import_boot_images_sets_proxy(self):
recorder = self.patch(tasks, 'check_call', Mock())
@@ -564,7 +564,7 @@
import_boot_images(http_proxy=proxy)
expected_env = dict(os.environ, http_proxy=proxy, https_proxy=proxy)
recorder.assert_called_once_with(
- ['sudo', '-n', 'maas-import-pxe-files'], env=expected_env)
+ ['sudo', '-n', '-E', 'maas-import-pxe-files'], env=expected_env)
def test_import_boot_images_sets_archive_locations(self):
self.patch(tasks, 'check_call')