From 91254a588f81c9b829a2eecfbfe8f0981248f51d Mon Sep 17 00:00:00 2001 From: Sam Thursfield Date: Mon, 24 Mar 2014 16:24:49 +0000 Subject: Be consistent with nfsboot_root path We were building it from a variable in some places and hardcoding it in others; now we build it from a variable everywhere. --- morphlib/exts/nfsboot.check | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/morphlib/exts/nfsboot.check b/morphlib/exts/nfsboot.check index e240dd72..f84f187f 100755 --- a/morphlib/exts/nfsboot.check +++ b/morphlib/exts/nfsboot.check @@ -80,12 +80,13 @@ class NFSBootCheckExtension(morphlib.writeexts.WriteExtension): 'nfs server by systemd' % server) # TFTP server exports /srv/nfsboot/tftp + tftp_root = os.path.join(self._nfsboot_root, 'tftp') try: cliapp.ssh_runcmd( - 'root@%s' % server, ['test' , '-d', '/srv/nfsboot/tftp']) + 'root@%s' % server, ['test' , '-d', tftp_root]) except cliapp.AppException: - raise cliapp.AppException('server %s does not export ' - '/srv/nfsboot/tftp' % server) + raise cliapp.AppException('server %s does not export %s' % + (tftp_root, server)) def version_exists(self, versioned_root, location): try: -- cgit v1.2.1 From 53af2f519658227f28b7a7427c66de6cf426da7a Mon Sep 17 00:00:00 2001 From: Sam Thursfield Date: Mon, 24 Mar 2014 16:26:30 +0000 Subject: Use os.environ[] instead of os.environ.get() to read a required variable --- morphlib/exts/nfsboot.write | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/morphlib/exts/nfsboot.write b/morphlib/exts/nfsboot.write index 3bb66821..8d3d6df7 100755 --- a/morphlib/exts/nfsboot.write +++ b/morphlib/exts/nfsboot.write @@ -62,7 +62,7 @@ class NFSBootWriteExtension(morphlib.writeexts.WriteExtension): temp_root, location = args version_label = os.getenv('VERSION_LABEL', 'factory') - hostname = os.environ.get('HOSTNAME') + hostname = os.environ['HOSTNAME'] versioned_root = os.path.join(self._nfsboot_root, hostname, 'systems', version_label) -- cgit v1.2.1