Fix report of installed packages on recent debian systems

Contributed by user dcliu (email currently unknown)

Symptoms: When you the autotest.client.package.info on the affected
OSes, it will always return package_info['installed'] = True whether or
not the package is actually installed.

Causes: This is a two fold problem. Firstly when dpkg -s does not find a
valid package name it will send it's reply in STDERR rather then STDOUT,
thus autotest never gets the reply.

Secondly the regex pattern does not work for more up to date distros:

testmachine# dpkg -s fds
Package `fds' is not installed and no info is available.
Use dpkg --info (= dpkg-deb --info) to examine archive files,
and dpkg --contents (= dpkg-deb --contents) to list their contents.

Adjust the output and the regexp to catch installed packages
more properly.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
Adding support in CLI "job create" for wildards when specifying metahost labels

This is a solution for issue #12.

When user specifies "job create ... -m 2*group* ..." it will expand to
scheduling job with all maching labels (e.g. group1, group2, group3);
This is applicable to all labels (not just platform)

Signed-off-by: Julius Gawlas <julius.gawlas@hp.com>
client.fsdev_disks: get_disk_list must return list of devices on machine

get_disk_list with non default arguments, std_mounts_only=False and
get_all_disks=True, must return all of the disks discoverable on the
system.

The code was incorrectly testing for device_name, resulting in skipping
the devices without partition. Since the device_name is no longer
needed, it can be removed.

Signed-off-by: Prasad Joshi <prasadjoshi.linux@gmail.com>
autoserv: repair global_config import.

Signed-off-by: Jiří Župka <jzupka@redhat.com>
server.test: Fix pylint complaint

During pylint checking, we've found:

************* Module server.test
E0202:159:_sysinfo_logger.before_hook: An attribute inherited from
_sysinfo_logger hide this method
E0202:169:_sysinfo_logger.before_iteration_hook: An attribute inherited
from _sysinfo_logger hide this method
E0202:185:_sysinfo_logger.after_iteration_hook: An attribute inherited
from _sysinfo_logger hide this method
E0202:200:_sysinfo_logger.after_hook: An attribute inherited from
_sysinfo_logger hide this method

In fact, the way the class _sysinfo_logger was disabling
before/after iteration hooks was by setting attributes set
to None to hide the iteration hooks methods. We could do
the same in a cleaner way by setting an attribute that
can switch on/off the execution of the code present in
these hook methods. So implement this and fix the pylint
complaints.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
frontend/db/backends/afe/base.py: Fix pylint complaint

pylint reveals:

************* Module frontend.db.backends.afe.base
E0203: 28:DatabaseWrapper._valid_connection: Access to member
'connection' before its definition line 35
E0203: 29:DatabaseWrapper._valid_connection: Access to member
'connection' before its definition line 35
E0203: 31:DatabaseWrapper._valid_connection: Access to member
'connection' before its definition line 35
E0203: 34:DatabaseWrapper._valid_connection: Access to member
'connection' before its definition line 35

Turns out that we do reference self.connection (in fact
defined on base classes), but for pylint this attribute
is not defined (machines that run pylint checks might
not have mysql-python installed). After checking the
code of the base classes, we verify that during init
self.connection is initialized with None anyway, so with
this change we silence yet another pylint complaint
(and since it's called before the base classes init
method, they'll take care of setting it to something
useful anyway).

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
server.hosts.factory: Fix incorrect name from module

AutoServError is in fact AutoservError in the error
module. Fix this little bug.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
utils/run_pylint.py: Ignore E1002 on quiet runs

Turns out we have way too many false positives on
E1002 errors (Use super on an old style class). So
disable this error and have less noisy full pylint
check reports.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
client: XML_utils cleanup and enhancement

+ Cleaned up many pylint/style warnings
+ Added unique extension for temp files retained due to exception
+ Unified del/exit-handling behavior
+ Added XMLTreeFile method for retrieving an XPATH to an element
+ Improved unittests

Signed-off-by: Chris Evich <cevich@redhat.com>
server: fixed path on import_site_class() usage

s/autotest_remote_lib/autotest/g for make_ssh_command and SiteHost

Signed-off-by: Chema Gonzalez <chema@google.com>
client: Reboot deadlocked node

If node is stuck w/o network we still have to have a chance to complete hardreset.

Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
client.tests: Update to the latest master

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>