summaryrefslogtreecommitdiff
path: root/morphlib
diff options
context:
space:
mode:
authorLars Wirzenius <lars.wirzenius@codethink.co.uk>2013-01-28 18:12:52 +0000
committerLars Wirzenius <lars.wirzenius@codethink.co.uk>2013-02-06 21:13:38 +0000
commit90d52f4205be5ce1eab04f97b0e4a71973258ddd (patch)
tree8c98b818c4b47287c3646a31b65ea126d998ea0c /morphlib
parentdfd854a0c1ce312ec20b91762be9a344d9c47417 (diff)
downloadmorph-90d52f4205be5ce1eab04f97b0e4a71973258ddd.tar.gz
Add cmdtest for "morph deploy" and rawdisk.write
Diffstat (limited to 'morphlib')
-rw-r--r--morphlib/plugins/deploy_plugin.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/morphlib/plugins/deploy_plugin.py b/morphlib/plugins/deploy_plugin.py
index 89f7ed07..eff1377c 100644
--- a/morphlib/plugins/deploy_plugin.py
+++ b/morphlib/plugins/deploy_plugin.py
@@ -20,6 +20,7 @@ import os
import shutil
import tarfile
import tempfile
+import urlparse
import uuid
import morphlib
@@ -34,6 +35,7 @@ class DeployPlugin(cliapp.Plugin):
arg_synopsis='TYPE SYSTEM LOCATION [KEY=VALUE]')
self.other = \
morphlib.plugins.branch_and_merge_plugin.BranchAndMergePlugin()
+ self.other.app = self.app
def disable(self):
pass
@@ -134,7 +136,7 @@ class DeployPlugin(cliapp.Plugin):
names = m['configuration-extensions']
for name in names:
self._run_extension(
- build_branch_root,
+ branch_dir,
build_ref,
name,
'.configure',
@@ -144,9 +146,9 @@ class DeployPlugin(cliapp.Plugin):
# Run write extension.
self.app.status(msg='Writing to device')
self._run_extension(
- build_branch_root,
+ branch_dir,
build_ref,
- name,
+ deployment_type,
'.write',
[system_tree, location],
env)
@@ -174,7 +176,7 @@ class DeployPlugin(cliapp.Plugin):
ext_filename = os.path.join(code_dir, 'exts', name + kind)
if not os.path.exists(ext_filename):
raise morphlib.Error(
- 'Could not find extenstion %s%s' % (name, kind))
+ 'Could not find extension %s%s' % (name, kind))
delete_ext = False
else:
fd, ext_filename = tempfile.mkstemp()
@@ -192,7 +194,7 @@ class DeployPlugin(cliapp.Plugin):
def _cat_file(self, repo_dir, ref, pathname):
'''Retrieve contents of a file from a git repository.'''
- argv = ['git', 'cat-file', 'blob', '%s:%s' % (ref, filename)]
+ argv = ['git', 'cat-file', 'blob', '%s:%s' % (ref, pathname)]
try:
return self.app.runcmd(argv, cwd=repo_dir)
except cliapp.AppException: