diff options
author | Tiago Gomes <tiago.gomes@codethink.co.uk> | 2013-06-13 15:01:40 +0000 |
---|---|---|
committer | Tiago Gomes <tiago.gomes@codethink.co.uk> | 2013-06-17 14:36:14 +0100 |
commit | a24fb36c476f3ed55f04f988ebe0a2246a6aa5fd (patch) | |
tree | 87c6aa47a101e741e06a4d90bfb4f5c887b701a8 /morphlib/exts/nfsboot.write | |
parent | d4d62cba266c08f35c79c1efe315cd4651135284 (diff) | |
download | morph-a24fb36c476f3ed55f04f988ebe0a2246a6aa5fd.tar.gz |
Change the symbolic link target and directory the default system on NFS server.
With this we'll have "default -> factory" instead of
"default-run" -> "factory/run".
Also change to use VERSION_LABEL instead of VERSION and
"factory" instead of "version1", to be more consistent with
other parts of the code.
Diffstat (limited to 'morphlib/exts/nfsboot.write')
-rwxr-xr-x | morphlib/exts/nfsboot.write | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/morphlib/exts/nfsboot.write b/morphlib/exts/nfsboot.write index 61c5306a..f43d3c98 100755 --- a/morphlib/exts/nfsboot.write +++ b/morphlib/exts/nfsboot.write @@ -66,15 +66,15 @@ class NFSBootWriteExtension(morphlib.writeexts.WriteExtension): 'with hostname "baserock"') self.test_good_server(location) - version = os.environ['VERSION'] or 'version1' + version_label = os.getenv('VERSION_LABEL', 'factory') versioned_root = os.path.join(self._nfsboot_root, hostname, 'systems', - version) + version_label) if self.version_exists(versioned_root, location): raise cliapp.AppException('Version %s already exists on' ' this device. Deployment aborted' - % version) + % version_label) self.copy_rootfs(temp_root, location, versioned_root, hostname) - self.copy_kernel(temp_root, location, versioned_root, version, + self.copy_kernel(temp_root, location, versioned_root, version_label, hostname) self.configure_nfs(location, hostname) @@ -171,15 +171,15 @@ class NFSBootWriteExtension(morphlib.writeexts.WriteExtension): raise cliapp.AppException('Could not create \'run\' rootfs' ' from \'orig\'') - self.status(msg='Linking \'default-run\' to latest system') + self.status(msg='Linking \'default\' to latest system') try: cliapp.ssh_runcmd('root@%s' % location, - ['ln', '-sfn', run_path, + ['ln', '-sfn', versioned_root, os.path.join(self._nfsboot_root, hostname, 'systems', - 'default-run')]) + 'default')]) except cliapp.AppException: - raise cliapp.AppException('Could not link \'default-run\' to %s' - % run_path) + raise cliapp.AppException('Could not link \'default\' to %s' + % versioned_root) def configure_nfs(self, location, hostname): exported_path = os.path.join(self._nfsboot_root, hostname) |