Skip to content
Snippets Groups Projects
Verified Commit 2389dcd8 authored by Karel Koci's avatar Karel Koci :metal:
Browse files

nsfarm/lxd: no longer require image file to be executable

It makes no sense as we reset access rights either way. Let's just check
if it is standard file and that is it.
parent 95dde32c
Branches
1 merge request!2Initial development
......@@ -3,12 +3,12 @@ Image definitions for NSFarm
This directory contains definitions of images used in NSFarm. Images define
content of container used during testing.
Image is defined by existence of executable file `NAME.sh` where `NAME` is name
for image used in NSFarm. Note that this is not name used in LXD (only part of
it). This file definition suppose to be a bash script. It is run in container to
prepare image. There is also a second part of image definition and that is
directory named `NAME` here. Content of this directory is merged to container as
it is.
Image is defined by existence of file `NAME.sh` in `/imgs` directory where `NAME`
is name for image used in NSFarm. Note that this is not name used in LXD (only
part of it). This file definition suppose to be a bash script. It is run in
container to prepare image. There is also a second part of image definition and
that is directory named `NAME` here. Content of this directory is merged to
container as it is.
It is expected that `NAME.sh` file has on first line shebang and on second line
name of base image to be used. It is suggested to continue with comment block with
......@@ -30,7 +30,7 @@ This is a limitation of image name having to be a valid hostname.
Base image
----------
The base idea of images is that we can stack them on top of each other and that
The base idea of images is that we can stack images on top of each other and that
makes it easier to have common base and additional scripts that do only minimal
changes to it. This concept is base image. In definition file `NAME.sh` this is
sourced from second line. Leading hash is expected and stripped.
......
File mode changed from 100755 to 100644
imgs/boot.sh 100755 → 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
......@@ -30,8 +30,6 @@ class Container():
# Verify existence of image definition
if not os.path.isfile(self._fpath):
raise Exception("There seems to be no file describing image: {}".format(self._fpath))
if not os.access(self._fpath, os.X_OK):
raise Exception("The file describing image is not executable: {}".format(self._fpath))
if not os.path.isdir(self._dpath):
self._dpath = None
# Make sure that we are connected to LXD
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment