Andrew Schoen [Fri, 19 Dec 2014 16:58:18 +0000 (10:58 -0600)]
Allow os_version and os_type to be None when locking bare metal nodes.
This fixes a bug that was defaulting os_version to 12.04 and os_type to
ubuntu when locking bare metal machines. We don't want to default the
os_version or os_type when locking bare metal so that the locking code
can pick whichever node is available.
VPS nodes will get proper defaults in provision.create_if_vm if they
aren't explicitly defined by either the config yaml or the cli flags.
Andrew Schoen [Thu, 18 Dec 2014 22:05:46 +0000 (16:05 -0600)]
When installing ceph-release log all install failures.
This code used to make an exception for 'already installed' failures
during a ceph-relase install and not log them. Unfortunately, this also
caused all other types of errors to not log at all. With this change
remote.run will log any errors that happen during the command.
Andrew Schoen [Wed, 17 Dec 2014 15:20:19 +0000 (09:20 -0600)]
Use teuthology.misc.get_distro and teuthology.misc.get_distro_
version in the internal.lock_machines task.
When the internal task wasn't using get_distro to retrieve os_type it
could set os_type to None, causing the lock to fail. This happened when
there was not an os_type defined in the config or a --os-type flag given.
Now, os_type will be properly defaulted to ubuntu when trying to lock
bare metal machines.
Andrew Schoen [Tue, 16 Dec 2014 15:38:21 +0000 (09:38 -0600)]
Respect --os-version and --os-type in teuthology.run.
Remove default value of 'ubuntu' for --os-type for teuthology.run and
make sure that teuthology.misc.get_distro accounts for ctx.os_type now
defaulting to None instead of 'ubuntu'.
Ilya Dryomov [Wed, 10 Dec 2014 06:10:12 +0000 (09:10 +0300)]
kernel: maybe_generate_initrd_rpm()
gitbuilder and local packages may not have initrd hooks in them,
depending on how old is the kernel - an appropriate %post section was
added to upstream spec only in 3.12.
Ilya Dryomov [Wed, 10 Dec 2014 10:01:23 +0000 (13:01 +0300)]
kernel: get_latest_image_version_{rpm, deb}()
A bit of refactoring to make things more clear and align distro case
with the rest of the code. get_version_from_pkg() is renamed to
get_latest_image_version_deb() and get_latest_image_version_rpm() is
introduced to match it.
Stop using rpm http url capabilities and download packages ourselves.
This keeps the structure the same for both rpms and debs and makes it
possible to fit in local rpm support. Drop the "rpm already installed"
check for the same reasons.
Ilya Dryomov [Mon, 8 Dec 2014 15:53:43 +0000 (18:53 +0300)]
kernel: fix 'sha1: distro' vs per role configs
We may want to setup different kernels for different roles (as long as
all roles on the same node agree on their choice), so returning as soon
as 'distro' is seen is not right. Also, no need to use find() as
'distro' is always an exact match.
Andrew Schoen [Fri, 12 Dec 2014 16:14:58 +0000 (10:14 -0600)]
remove the status from the call to paddles from worker; this allows the job's updated time to change without changing it's status. The status of the job could be either running or waiting
Dan Mick [Thu, 11 Dec 2014 22:34:07 +0000 (14:34 -0800)]
teuthology.run: conditionally add fake_ctx to teuthology.config.config
The intent here is to get the 'interactive-on-error' config value
passed down to contextutil.nested(), but it is recognized that we need
a way to share global configuration; for now, since nested() really
needs the entire ctx, we can get it out of fake_ctx.config, but there
needs to be a cleaner way as FakeNamespace is phased out.
Fixes: #10260 Signed-off-by: Dan Mick <dan.mick@redhat.com>
Ilya Dryomov [Mon, 8 Dec 2014 14:25:11 +0000 (17:25 +0300)]
kernel: get_sha1_from_pkg_name()
Move package name parsing into its own routine and make the regex more
robust:
- match only hex chars
- don't limit ourselves to 7 chars, match up to 40 chars
- accept 'g' prefixed with either _ (rpm) or - (deb)
Ilya Dryomov [Fri, 5 Dec 2014 17:26:30 +0000 (20:26 +0300)]
kernel: fix commit hash matching in need_to_install(), take 2
Commit 10d7f9095fbb ("kernel: fix commit hash matching in
need_to_install()") switched startswith() around to accommodate
a shorter "want" version. That however broke the opposite case: when
installing from gitbuilders "want" is actually a full 40-char hash.
Do away with starswith() and just compare substrings.
Sandon Van Ness [Tue, 9 Dec 2014 19:58:33 +0000 (11:58 -0800)]
Don't assume y on distro kernel reinstall...
Because if its the running kernel yum will skip the current
version and install install an older package? WTF? I would not
expect such behavior from a reinstall but it is what it is...
Also skipping current running kernel output was in stderr not the
stdout so I made changes to reflect that.
Signed-off-by: Sandon Van Ness <sandon@redhat.com>
Andrew Schoen [Tue, 2 Dec 2014 21:27:09 +0000 (15:27 -0600)]
modified __getattr__ for FakeNamespace so that it raises AttributeError on a missing attr. This allows a FakeNamespace instance to work correctly with getattr(). Also removed .get() from YamlConfig as we decided it was unnecessary
Andrew Schoen [Wed, 26 Nov 2014 15:44:23 +0000 (09:44 -0600)]
Various bug fixes while running tests on this branch in the octo lab.
Made YamlConfig work more closely like a dictionary by extending
collections.MutableMapping. It still needs some work to be able to be
used interchangeably with a dict - most noteably with yaml.safe_dump.
Decided to just use a dict instead of JobConfig for args['<config>'].
Too many other codepaths are assuming that config is a dict.
Andrew Schoen [Mon, 24 Nov 2014 23:01:33 +0000 (17:01 -0600)]
Ports the teuthology.run command to docopt instead of argparse.
This is a pretty massive refactor to make the code more testable as
well. The coverage on teuthology.run was increased from 0% to 86% and
the overall project coverage increased to 24%.
Andrew Schoen [Mon, 24 Nov 2014 18:16:51 +0000 (12:16 -0600)]
Creates a merge_configs function in teuthology.misc that will be used
by run and schedule, nuke will need this eventually as well. The old
way of doing this was too tightly coupled with argparse. Wrote some
tests around the new function; increased coverage on misc by 4%.
Andrew Schoen [Fri, 21 Nov 2014 17:58:58 +0000 (11:58 -0600)]
Adds a FakeNamespace object to teuthology.config that mimics
what an argparse Namespace looks like when teuthology.misc.read_config
is used on it. This allows us to refactor our commands to use docopt
but still all all the tasks to be passed one big namespace.