[libvirt] [jenkins-ci PATCH] guests: Only attempt to fix intltool-update if it exists

If we're running against a freshly-provisioned FreeBSD guest, intltool won't have been installed yet and attempts to fix it will fail. Make sure the file exists. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- guests/tasks/kludges.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/guests/tasks/kludges.yml b/guests/tasks/kludges.yml index 4dd06a4..0ad61a7 100644 --- a/guests/tasks/kludges.yml +++ b/guests/tasks/kludges.yml @@ -52,6 +52,13 @@ # wait for the port to be fixed, we can patch things up ourselves. # # See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=227444 +- name: Look for intltool-update + stat: + path: /usr/local/bin/intltool-update + register: intltoolupdate + when: + - os_name == 'FreeBSD' + - name: Fix intltool-update replace: path: /usr/local/bin/intltool-update @@ -59,3 +66,4 @@ replace: '\1 !~ /\\$\\{?$2}?/;' when: - os_name == 'FreeBSD' + - intltoolupdate.stat.exists -- 2.14.3

On Fri, Apr 13, 2018 at 06:52:20PM +0200, Andrea Bolognani wrote:
If we're running against a freshly-provisioned FreeBSD guest, intltool won't have been installed yet and attempts to fix it will fail. Make sure the file exists.
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- guests/tasks/kludges.yml | 8 ++++++++ 1 file changed, 8 insertions(+)
How this will work to fix the FreeBSD installation for the freshly-provisioned guest? This would require running './lcitool prepare $guest' and again './lcitool update $guest'. We need to probably split kludges task into two separate tasks where one will be executed before installing project dependencies to fix base-os issues and second one executed after all dependencies are installed to fix the remaining issues. Pavel

On Mon, 2018-04-16 at 10:29 +0200, Pavel Hrdina wrote:
How this will work to fix the FreeBSD installation for the freshly-provisioned guest? This would require running './lcitool prepare $guest' and again './lcitool update $guest'.
Correct.
We need to probably split kludges task into two separate tasks where one will be executed before installing project dependencies to fix base-os issues and second one executed after all dependencies are installed to fix the remaining issues.
Mh, I kinda wanted to avoid doing that, but I guess it's way more user-friendly to do it the way you suggested. v2 coming right up :) -- Andrea Bolognani / Red Hat / Virtualization

On Mon, 2018-04-16 at 10:43 +0200, Andrea Bolognani wrote:
On Mon, 2018-04-16 at 10:29 +0200, Pavel Hrdina wrote:
We need to probably split kludges task into two separate tasks where one will be executed before installing project dependencies to fix base-os issues and second one executed after all dependencies are installed to fix the remaining issues.
Mh, I kinda wanted to avoid doing that, but I guess it's way more user-friendly to do it the way you suggested. v2 coming right up :)
Actually, we can keep it simple by including tasks/kludges.yml a second time *after* installing packages. All changes performed in there are idempotent, so it will add pretty much no execution time to a 'lcitool update' run and avoids having to split the task. Basically I would squash in: ----- 8< ----- 8< ----- diff --git a/guests/site.yml b/guests/site.yml index 26127be..d208e5d 100644 --- a/guests/site.yml +++ b/guests/site.yml @@ -55,3 +55,7 @@ - include: tasks/jenkins.yml when: - flavor == 'jenkins' + + # Some of the kludges involve tweaking files that are included in + # the packages we just installed, so go through them again here + - include: tasks/kludges.yml ----- >8 ----- >8 ----- Does that sound reasonable? -- Andrea Bolognani / Red Hat / Virtualization

On Mon, Apr 16, 2018 at 10:56:02AM +0200, Andrea Bolognani wrote:
On Mon, 2018-04-16 at 10:43 +0200, Andrea Bolognani wrote:
On Mon, 2018-04-16 at 10:29 +0200, Pavel Hrdina wrote:
We need to probably split kludges task into two separate tasks where one will be executed before installing project dependencies to fix base-os issues and second one executed after all dependencies are installed to fix the remaining issues.
Mh, I kinda wanted to avoid doing that, but I guess it's way more user-friendly to do it the way you suggested. v2 coming right up :)
Actually, we can keep it simple by including tasks/kludges.yml a second time *after* installing packages. All changes performed in there are idempotent, so it will add pretty much no execution time to a 'lcitool update' run and avoids having to split the task.
Basically I would squash in:
----- 8< ----- 8< ----- diff --git a/guests/site.yml b/guests/site.yml index 26127be..d208e5d 100644 --- a/guests/site.yml +++ b/guests/site.yml @@ -55,3 +55,7 @@ - include: tasks/jenkins.yml when: - flavor == 'jenkins' + + # Some of the kludges involve tweaking files that are included in + # the packages we just installed, so go through them again here + - include: tasks/kludges.yml ----- >8 ----- >8 -----
Does that sound reasonable?
Right, that's good enough. Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
participants (2)
-
Andrea Bolognani
-
Pavel Hrdina