Andrew Schoen [Mon, 12 Jan 2015 17:22:11 +0000 (11:22 -0600)]
New internal task to check packages and fail the job if any are missing
Introduces a new task, internal.check_packages, that checks gitbuilder
for ceph packages for the given os_type and sha1 defined in the job
config. If no packages are found, fail the job. This new task is ran
before any other tasks.
Andrew Schoen [Fri, 9 Jan 2015 19:50:11 +0000 (13:50 -0600)]
Allow runs that have jobs with missing packages to schedule.
Runs that have jobs with missing packages will now schedule successfully
instead of throwing an exception and sending an email of the failure.
However, the jobs with missing packages are tracked and printed when
--dry-run is used.
Extracted the code that did these checks from schedule_suite so that it
could be reused elsewhere. Wrote unit tests on these newly extracted functions.
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>