Update reboot task to run async from installer and install module

rhbz#955543

Signed-off-by: Joey Boggs <jboggs@redhat.com>
Change-Id: Ic1b4e048ff56b8c9ebd49a82b3d5546c7c326df8
process: Allow override of common args

Previously the common args to Popen couldn't be overriden, this is now
possible.

Change-Id: I3d0aeffe04bea7892f548662372d10a87a87cd11
Signed-off-by: Fabian Deutsch <fabiand@fedoraproject.org>
Signed-off-by: Mike Burns <mburns@redhat.com>
utils: Add lockfile to transactions

Previously multiple transaction could be run at once. Now a lock is
acuired before each transaction run to enforce only one transaction urn
at a time.

Change-Id: I0f3bfd60f2cda41ffcf13ff6dfc224d6d2d4a3ab
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=971673
Signed-off-by: Fabian Deutsch <fabiand@fedoraproject.org>
Signed-off-by: Mike Burns <mburns@redhat.com>
fs: Introduce File and FakeFs

Two classes are added to allow unittesting without access to the
filesystem.
Previously unit tests were nearly impossible because of the many
informations which are retrieved from the filesystem (at runtime).
by wrapping the file i/o in a class a mocking framework (e.g.
python-mock) can be used to patch this file i/o class during unit tests
and redirect file i/o requests to a fake filesystem (e.g. an
in-memory fs).
FakeFs is a simple class implementing such a fake in-memory filesystem
which can be used during unit tests.

Change-Id: I7889240a956b359f2375955766f3cafcfbeaf0ee
Signed-off-by: Fabian Deutsch <fabiand@fedoraproject.org>
Signed-off-by: Mike Burns <mburns@redhat.com>
network: Rework runtime network model

Previously there were strong assumptions about the runtime network
setup, thse assumptions are now more relaxed.
The code is now able to parse more complex setups.

Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=971410
Change-Id: I8053ea21af5029190bc16b89ee109d2d7937a05f
Signed-off-by: Fabian Deutsch <fabiand@fedoraproject.org>
Signed-off-by: Mike Burns <mburns@redhat.com>
network: Rewrite network config backend

The network backend doing the actual OS level configuration work was
rewritten to allow different topologies, the migration to NM also had
an impact on the design decisions.

Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=971410
Change-Id: I653023c9f856f1be51e45b86457ce24a3878015b
Signed-off-by: Fabian Deutsch <fabiand@fedoraproject.org>
Signed-off-by: Mike Burns <mburns@redhat.com>
Use fs.File in more places

Change-Id: I33e057c4caefaba5fa3cc97bd26773a2c8ba09f8
Signed-off-by: Fabian Deutsch <fabiand@fedoraproject.org>
Signed-off-by: Mike Burns <mburns@redhat.com>
config: Use FakeFs for defaults doctests

Change-Id: Iceb4ddc6c8d400a971bd4e95616a58d62e4fcccf
Signed-off-by: Fabian Deutsch <fabiand@fedoraproject.org>
Signed-off-by: Mike Burns <mburns@redhat.com>
test: Add basic unit test infrasturcture

Change-Id: I3c3419a3c045a9afe76dd42508e743426d1f98c6
Signed-off-by: Fabian Deutsch <fabiand@fedoraproject.org>
Signed-off-by: Mike Burns <mburns@redhat.com>
test: Add unit test for network config

Change-Id: I7746e5d4f06637c70b2a7412ee277b57fdd2ec60
Signed-off-by: Fabian Deutsch <fabiand@fedoraproject.org>
Signed-off-by: Mike Burns <mburns@redhat.com>
Replace legacy network backend with new backend

After creating the backend this patch replaces all occurrences of the
old backend code with the new backend.

Change-Id: I30378deb42c270d615353110fcf86ec79d18a345
Signed-off-by: Fabian Deutsch <fabiand@fedoraproject.org>
Signed-off-by: Mike Burns <mburns@redhat.com>
installer: Use transaction for auto-installation

Change-Id: I26e93e6ec664a31810350dd8a25c86c6afe1e2eb
Signed-off-by: Fabian Deutsch <fabiand@fedoraproject.org>
Signed-off-by: Mike Burns <mburns@redhat.com>
defaults: Use system.service() in more places

Change-Id: I8150ab1bb304707645aa107e1778776ff0da6012
Signed-off-by: Fabian Deutsch <fabiand@fedoraproject.org>
Signed-off-by: Mike Burns <mburns@redhat.com>
init: Add support for network_topology karg

The network_topology kernel argument can be used to tell Node what kind
of network to setup during an auto-installation.
Currently there are two flavors:
- bridged - The classic Node network topology (Node-Birdge-NIC-Network)
- direct - Direct connection via a NIC (Node-NIC-Network)

Change-Id: I69c4d08531f724c5ae9e4f2350926baa1deb0e5b
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=971410
Signed-off-by: Fabian Deutsch <fabiand@fedoraproject.org>
Signed-off-by: Mike Burns <mburns@redhat.com>
test: Add a unit test for bridgeless networking

And enhance some doctests.

Change-Id: I5ec5225713981201ae158f9810ccf915cdb2efa1
Signed-off-by: Fabian Deutsch <fabiand@fedoraproject.org>
Signed-off-by: Mike Burns <mburns@redhat.com>
ui: Don't assume a set BOOTIF

Previously the UI used the BOOTIF param to determin the primary
interface. Because this param is not always set (e.g. after
auto-install). There is now a logic which treis to detect the configured
(or primary) NIC.

Change-Id: Ib58a1dae6e36aa3b9c16bec66bfdd6eb56d05c9e
Signed-off-by: Fabian Deutsch <fabiand@fedoraproject.org>
Signed-off-by: Mike Burns <mburns@redhat.com>
init: Don't drop BOOTIF

Previously the BOOTIF param was dropped from our config file during
ovirt-early.
Now the BOOTIF param is kept, to provide informations about the
to be confgured interface to the UI.

Change-Id: If06ee5f79489f9e7098858ce995db5c19c71d99d
Signed-off-by: Fabian Deutsch <fabiand@fedoraproject.org>
Signed-off-by: Mike Burns <mburns@redhat.com>
fix: Keep bootproto in config file

Previously the bootproto (or other changes) were dropped from the cfg
file, due to some legacy code. Now the cfg file is kept as it was and
it's beeing worked around this problem.
Additionally the UI code was changed to use the features of the new NIC
classes.

Change-Id: I5098b1a6b2b5b6b4515e8a79b4fd85c7e4fbcc1e
Signed-off-by: Fabian Deutsch <fabiand@fedoraproject.org>
Signed-off-by: Mike Burns <mburns@redhat.com>
init: Add mechanism for break points

A new mechanism is added to add breakpoints to the boot process. This is
mainly intended for debugging purposes.
This patch adds the node.break=pre-reboot break point, which drops to a
shell right before rebooting (if the reboot happens during an
auto-install or uninstall).

Change-Id: Ifa0ccdf6eb80529992ab3e8b948a30fd9cd4d3b7
Signed-off-by: Fabian Deutsch <fabiand@fedoraproject.org>
Signed-off-by: Mike Burns <mburns@redhat.com>
ui: Fix clipping of Entry contents

Previously the text just disappeared, now the entry field scrolls to the
correct place in the text.

Change-Id: Ia4827648dee546c64ceea81cb833c434a780878f
Signed-off-by: Fabian Deutsch <fabiand@fedoraproject.org>
Signed-off-by: Mike Burns <mburns@redhat.com>