summaryrefslogtreecommitdiff
path: root/extensions/rawdisk.check
diff options
context:
space:
mode:
authorAdam Coldrick <adam.coldrick@codethink.co.uk>2015-06-19 15:33:22 +0000
committerAdam Coldrick <adam.coldrick@codethink.co.uk>2015-06-19 15:33:22 +0000
commit53a5919884b98613a99fe7a8397e9f2f01190b8f (patch)
tree1422b88cbba6ca6da5e45bf50690d152ceb529ab /extensions/rawdisk.check
parentcd9e3ba567a704af2585ad5b46d5b1eb9609fdd4 (diff)
parente4c6b8a69f0df2d0b3beac46865a66e0de527151 (diff)
downloaddefinitions-53a5919884b98613a99fe7a8397e9f2f01190b8f.tar.gz
Merge branch 'baserock/adamcoldrick/remove-dependencies-v3'
This stops the deployment extensions from depending on morphlib and cliapp, as well as setting the definitions version to 5. Reviewed-by: Sam Thursfield <sam.thursfield@codethink.co.uk> Reviewed-by: Paul Sherwood <paul.sherwood@codethink.co.uk>
Diffstat (limited to 'extensions/rawdisk.check')
-rwxr-xr-xextensions/rawdisk.check17
1 files changed, 8 insertions, 9 deletions
diff --git a/extensions/rawdisk.check b/extensions/rawdisk.check
index 9be0ce91..61619a21 100755
--- a/extensions/rawdisk.check
+++ b/extensions/rawdisk.check
@@ -15,17 +15,16 @@
'''Preparatory checks for Morph 'rawdisk' write extension'''
-import cliapp
-
-import morphlib.writeexts
-
import os
+import writeexts
+
-class RawdiskCheckExtension(morphlib.writeexts.WriteExtension):
+class RawdiskCheckExtension(writeexts.WriteExtension):
def process_args(self, args):
if len(args) != 1:
- raise cliapp.AppException('Wrong number of command line args')
+ raise writeexts.ExtensionError(
+ 'Wrong number of command line args')
self.require_btrfs_in_deployment_host_kernel()
@@ -34,19 +33,19 @@ class RawdiskCheckExtension(morphlib.writeexts.WriteExtension):
if upgrade:
if not self.is_device(location):
if not os.path.isfile(location):
- raise cliapp.AppException(
+ raise writeexts.ExtensionError(
'Cannot upgrade %s: it is not an existing disk image' %
location)
version_label = os.environ.get('VERSION_LABEL')
if version_label is None:
- raise cliapp.AppException(
+ raise writeexts.ExtensionError(
'VERSION_LABEL was not given. It is required when '
'upgrading an existing system.')
else:
if not self.is_device(location):
if os.path.exists(location):
- raise cliapp.AppException(
+ raise writeexts.ExtensionError(
'Target %s already exists. Use `morph upgrade` if you '
'want to update an existing image.' % location)