summaryrefslogtreecommitdiff
path: root/morphlib/plugins/deploy_plugin.py
diff options
context:
space:
mode:
authorRichard Maw <richard.maw@codethink.co.uk>2013-08-09 13:34:39 +0000
committerRichard Maw <richard.maw@codethink.co.uk>2013-08-13 14:21:57 +0000
commit70f66833fc407d72e4bae53c50580d4066152761 (patch)
tree4480bbc4f4e1696365b0ae72b75fa41acf783f07 /morphlib/plugins/deploy_plugin.py
parentec6d4e10304293157ba61501b7f053cb1cbc142a (diff)
downloadmorph-70f66833fc407d72e4bae53c50580d4066152761.tar.gz
deploy: Parse arguments before unpack
It's a waste of time to unpack the rootfs, only to have to clean it up again when you find out that you messed up the command line arguments. This also has the benefit of reducing the amount of resources that have to be considered for cleanup.
Diffstat (limited to 'morphlib/plugins/deploy_plugin.py')
-rw-r--r--morphlib/plugins/deploy_plugin.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/morphlib/plugins/deploy_plugin.py b/morphlib/plugins/deploy_plugin.py
index edc4a81a..092441ec 100644
--- a/morphlib/plugins/deploy_plugin.py
+++ b/morphlib/plugins/deploy_plugin.py
@@ -225,6 +225,9 @@ class DeployPlugin(cliapp.Plugin):
location = args[2]
env_vars = args[3:]
+ # Set up environment for running extensions.
+ env = morphlib.util.parse_environment_pairs(os.environ, env_vars)
+
# Deduce workspace and system branch and branch root repository.
workspace = self.other.deduce_workspace()
branch, branch_dir = self.other.deduce_system_branch()
@@ -302,9 +305,6 @@ class DeployPlugin(cliapp.Plugin):
msg='System unpacked at %(system_tree)s',
system_tree=system_tree)
- # Set up environment for running extensions.
- env = morphlib.util.parse_environment_pairs(os.environ, env_vars)
-
# Extensions get a private tempdir so we can more easily clean
# up any files an extension left behind
deploy_private_tempdir = tempfile.mkdtemp(dir=deploy_tempdir)