diff options
author | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2014-10-08 14:43:28 +0100 |
---|---|---|
committer | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2014-10-08 14:43:28 +0100 |
commit | 6fdb886894dd320494fb386ecb6fe9f89ce874aa (patch) | |
tree | f85d33dddfc49b28155e47378c7e02e586b04b95 | |
parent | 8b85d60e9294713097928d52b8ca4cfe5d5f801a (diff) | |
parent | d1a87822e936afa9dc8618ff23dca09da050b65a (diff) | |
download | morph-6fdb886894dd320494fb386ecb6fe9f89ce874aa.tar.gz |
Merge branch 'sam/handle-missing-version-label'
Reviewed-By: Pedro Alvarez <pedro.alvarez@codethink.co.uk>
Reviewed-By: Francisco Redondo Marchena <francisco.marchena@codethink.co.uk>
-rwxr-xr-x | morphlib/exts/ssh-rsync.check | 7 | ||||
-rwxr-xr-x | morphlib/exts/ssh-rsync.write | 2 |
2 files changed, 7 insertions, 2 deletions
diff --git a/morphlib/exts/ssh-rsync.check b/morphlib/exts/ssh-rsync.check index 6a776ce9..11446c28 100755 --- a/morphlib/exts/ssh-rsync.check +++ b/morphlib/exts/ssh-rsync.check @@ -18,8 +18,9 @@ import cliapp -import morphlib.writeexts +import os +import morphlib.writeexts class SshRsyncCheckExtension(morphlib.writeexts.WriteExtension): def process_args(self, args): @@ -33,6 +34,10 @@ class SshRsyncCheckExtension(morphlib.writeexts.WriteExtension): 'Baserock machines. It cannot be used for an initial ' 'deployment.') + if os.environ.get('VERSION_LABEL', '') == '': + raise cliapp.AppException( + 'A VERSION_LABEL must be set when deploying an upgrade.') + location = args[0] self.check_ssh_connectivity(location) self.check_is_baserock_system(location) diff --git a/morphlib/exts/ssh-rsync.write b/morphlib/exts/ssh-rsync.write index 468e5a1f..775619ec 100755 --- a/morphlib/exts/ssh-rsync.write +++ b/morphlib/exts/ssh-rsync.write @@ -60,7 +60,7 @@ class SshRsyncWriteExtension(morphlib.writeexts.WriteExtension): self.complete_fstab_for_btrfs_layout(temp_root, uuid) - version_label = os.environ.get('VERSION_LABEL') + version_label = os.environ['VERSION_LABEL'] autostart = self.get_environment_boolean('AUTOSTART') self.status(msg='Creating remote mount point') |