diskimage-builder/diskimage_builder/elements
Ian Wienand 97c01e48ed Move elements & lib relative to diskimage_builder package
Currently we have all our elements and library files in a top-level
directory and install them into
<root>/share/diskimage-builder/[elements|lib] (where root is either /
or the root of a virtualenv).

The problem with this is that editable/development installs (pip -e)
do *not* install data_files.  Thus we have no canonical location to
look for elements -- leading to the various odd things we do such as a
whole bunch of guessing at the top of disk-image-create and having a
special test-loader in tests/test_elements.py so we can run python
unit tests on those elements that have it.

data_files is really the wrong thing to use for what are essentially
assets of the program.  data_files install works well for things like
config-files, init.d files or dropping documentation files.

By moving the elements under the diskimage_builder package, we always
know where they are relative to where we import from.  In fact,
pkg_resources has an api for this which we wrap in the new
diskimage_builder/paths.py helper [1].

We use this helper to find the correct path in the couple of places we
need to find the base-elements dir, and for the paths to import the
library shell functions.

Elements such as svc-map and pkg-map include python unit-tests, which
we do not need tests/test_elements.py to special-case load any more.
They just get found automatically by the normal subunit loader.

I have a follow-on change (I69ca3d26fede0506a6353c077c69f735c8d84d28)
to move disk-image-create to a regular python entry-point.

Unfortunately, this has to move to work with setuptools.  You'd think
a symlink under diskimage_builder/[elements|lib] would work, but it
doesn't.

[1] this API handles stuff like getting files out of .zip archive
modules, which we don't do.  Essentially for us it's returning
__file__.

Change-Id: I5e3e3c97f385b1a4ff2031a161a55b231895df5b
2016-11-01 17:27:41 -07:00
..
apt-conf Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
apt-preferences Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
apt-sources Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
architecture-emulation-binaries Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
baremetal Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
base Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
bootloader Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
cache-url Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
centos Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
centos7 Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
centos-minimal Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
cleanup-kernel-initrd Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
cloud-init Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
cloud-init-datasources Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
cloud-init-disable-resizefs Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
cloud-init-nocloud Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
debian Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
debian-minimal Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
debian-systemd Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
debian-upstart Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
debootstrap Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
deploy-baremetal Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
deploy-kexec Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
deploy-targetcli Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
deploy-tgtadm Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
devuser Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
dhcp-all-interfaces Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
dib-init-system Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
dib-python Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
dib-run-parts/root.d Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
disable-selinux/post-install.d Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
dkms Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
docker Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
dpkg Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
dracut-network Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
dracut-ramdisk Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
dynamic-login Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
element-manifest Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
enable-serial-console Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
epel Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
fedora Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
fedora-minimal Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
gentoo Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
growroot Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
grub2 Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
hpdsa Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
hwburnin Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
hwdiscovery Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
ilo Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
install-bin Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
install-static Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
install-types Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
ironic-agent Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
iso Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
local-config Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
manifests Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
mellanox Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
modprobe-blacklist Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
no-final-image Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
oat-client Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
opensuse Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
package-installs Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
partitioning-sfdisk Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
pip-and-virtualenv Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
pip-cache Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
pkg-map Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
posix Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
proliant-tools Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
pypi Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
ramdisk Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
ramdisk-base Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
rax-nova-agent Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
redhat-common Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
rhel Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
rhel7 Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
rhel-common Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
rpm-distro Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
runtime-ssh-host-keys Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
select-boot-kernel-initrd Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
selinux-permissive Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
simple-init Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
source-repositories Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
stable-interface-names Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
svc-map Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
uboot Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
ubuntu Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
ubuntu-core Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
ubuntu-minimal Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
ubuntu-signed Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
vm Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
yum Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
yum-minimal Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00
zypper Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00