summaryrefslogtreecommitdiff
path: root/morphlib/exts/nfsboot.write
diff options
context:
space:
mode:
authorTiago Gomes <tiago.gomes@codethink.co.uk>2013-06-13 15:01:40 +0000
committerTiago Gomes <tiago.gomes@codethink.co.uk>2013-06-17 14:36:14 +0100
commita24fb36c476f3ed55f04f988ebe0a2246a6aa5fd (patch)
tree87c6aa47a101e741e06a4d90bfb4f5c887b701a8 /morphlib/exts/nfsboot.write
parentd4d62cba266c08f35c79c1efe315cd4651135284 (diff)
downloadmorph-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-xmorphlib/exts/nfsboot.write18
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)