process: Make use of shell explicit

Previously some methods in the process module implicitly used the shell
keyword-argument, some others didn't.
If the shell=True arg is used, then Popen will allow and interprete a
string as the cmd, e.g. "ls /tmp" and will do the right thing. If
shell=False the Popen will look for a command named "ls /tmp". Because
in the case of shell=False, Popen expects a list, the first item in the
list beeing the command itself, and the subsequent items beeing
arguments to that command.

This patch removes the implicit use if shell=True to have the same usage
pattern accross all functions in the process module.
This prepares to solve problems e.g. related to kdump.

Summarized:
Args need to be a list in the default (shell=False) case:
process.call(["ls", "/tmp"])
This is a save way of calling a function with arguments, because quoting
the args is done by python.

Args need to be a string in the shell=True case:
process.call("ls /tmp | grep something", shell=True)
The string will be interpreted by a shell, thus all shell features can
be used in that string, but also quotation is up to the user and
therefor considered as unsafe.

Change-Id: I3cbc920e07fd4c3890028fe2f2d006e1be7c2ae6
Signed-off-by: Fabian Deutsch <fabiand@fedoraproject.org>
init: Add more breakpoints

Change-Id: I753ed8a4bd7cf5f45b1ae79cd63bf1038009abbf
Signed-off-by: Fabian Deutsch <fabiand@fedoraproject.org>
network: Silence rmmod bonding

Previously a warning cluttered the AI process b/c rmmod tried to remove
the bonding module even if it wasn't loaded.

Change-Id: Ie976ef6e194c65d40affaa8644bbc6370ba17ad7
Signed-off-by: Fabian Deutsch <fabiand@fedoraproject.org>
auto-installer: Add debug mode

Change-Id: I7f1d7bc7da298ed03e27e7ab4d29963076ddb4ec
Signed-off-by: Fabian Deutsch <fabiand@fedoraproject.org>
services: Adjust service dependencies

Previously firstboot (and others) depended on systemd services or
targets which could go down during the original's service runtime.
Because some target service would depend on a service it would bring
down, systemd would also kill the target service (because a dependency
wasn't met anymore).

Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=983547
Change-Id: I0596c054cd996d10032f737a8fcc010d60254bf0
Signed-off-by: Fabian Deutsch <fabiand@fedoraproject.org>
init: Don't trap all signals

The main reason for removing the trap is to pass the the signal back to
the caller of the init script (systemd, sysV) to enable a better
debugging.

Change-Id: I4b7218ef80ac51834445477e1a57f5a64ca3dc2c
Signed-off-by: Fabian Deutsch <fabiand@fedoraproject.org>
auto-install: Don't call sys.exit()

Python will do the right thing (tm). Exit wqith 0 if no exception is
raised, 1 otherwise.

Change-Id: Ideb603a831a4932809c04205c14c0a90acafad10
Signed-off-by: Fabian Deutsch <fabiand@fedoraproject.org>
init: Add initial support for node.log_level=debug

This is used to enable the debug mode of the auto-installer.

Change-Id: Ifdae5cc10479509519dc1362e3e00c8f4f7fe300
Signed-off-by: Fabian Deutsch <fabiand@fedoraproject.org>
process: Fix check_output on el6

Due to the previous process patch all process related functions expect
lists, but the el6 workaround for check_output passed a string.

Change-Id: I63edf019078e877404d2727b5fd97f24979dbeda
Signed-off-by: Fabian Deutsch <fabiand@fedoraproject.org>
test: Mock Augeas

Augeas can not be used, because it's ont using the FakeFs but trying to
act on the real filesystem.

Change-Id: I3be2dad2ed7b708691402d011c8e9a87b0791a1b
Signed-off-by: Fabian Deutsch <fabiand@fedoraproject.org>
Add password_check to password fields

Previously no “weak password" indication when set a weak password
in password_page.
Now the migrated password_check function was used in the pasword
wigets to return informative messages to the user.
Also add password_check for upgrade_page

Change-Id: Iff668859b72176c64b4bbc2a08ac6419d021271b
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=983449
Signed-off-by: hadong <hadong0720@gmail.com>
Use seperate line to display Rsyslog and Netconsole

Previously using comma to divide Rsyslog and Netconsole info in
status page.
Now using seperate line to display them.

Change-Id: Ic53043ccd106c57ff4ddd95a665fea351e64da7b
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=981265
Signed-off-by: hadong <hadong0720@gmail.com>
Add validation for SSH Location

Previously missed validation for SSH Location
when configuring kdump with ssh.
Now add it for ssh location.

Change-Id: I7d9153cdd7cddecf238a82d7e1639f74386795fe
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=981576
Signed-off-by: hadong <hadong0720@gmail.com>
change "local console access" to "the admin user"

Slightly less ambiguous by using "Require a password for the admin user"
instead of "Require a password for local console access" for password_
page and upgrade_page.

Change-Id: I0e838da773a352c8ee43c20217b72428a1138a59
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=984344
Signed-off-by: hadong <hadong0720@gmail.com>
ui: Fix kdump page w/ no networking

Change-Id: I4a630d4d775c3abafb5549a32092890378550655
Signed-off-by: Fabian Deutsch <fabiand@fedoraproject.org>
system: Make which() testable

Previously which() used direct FS access, now the File class is used.
Additionally the method was changed to not raise an Exception if a cmd
was not found, instead None is returned.

Change-Id: I37081b4aa34ed3060f1503961d545eb7322bd4b3
Signed-off-by: Fabian Deutsch <fabiand@fedoraproject.org>
kdump: Fix kdumpctl call

kdumpctl moved it's location, this lead to problems.

Change-Id: I2a53c98360d56268ccc41018fa8b5816227605ac
Signed-off-by: Fabian Deutsch <fabiand@fedoraproject.org>
kdump Show transaction error in UI dialog

Previously the UI quit in the case of a problem within the kdump page.
Now the exception is shown on the screen instead of quitting the whole
application.

Change-Id: I7e326e1f49552b696fc77f33ffbd1588aa833f6f
Signed-off-by: Fabian Deutsch <fabiand@fedoraproject.org>
ui: Allow digit for IPv4 and IPv6 netmasks

Change-Id: I48bf6c9cc2fe41c3358bdc11962a7eaaa4200652
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=981168
Signed-off-by: Fabian Deutsch <fabiand@fedoraproject.org>
Using validator "SnmpPassword" into SNMP Password Entry

Previously miss validations for SNMP password to check it
without spaces and at least 8 chars.
Now add validator "SnmpPassword" into SNMP Password Entry

Change-Id: I3b58ee0776eab2c2e540206ef04f357b24544acc
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=984450
Signed-off-by: hadong <hadong0720@gmail.com>