Merge lp:~raharper/curtin/trunk.disable_yum_plugins into lp:~curtin-dev/curtin/trunk

Proposed by Ryan Harper
Status: Merged
Merged at revision: 515
Proposed branch: lp:~raharper/curtin/trunk.disable_yum_plugins
Merge into: lp:~curtin-dev/curtin/trunk
Diff against target: 44 lines (+18/-8)
1 file modified
curtin/commands/curthooks.py (+18/-8)
To merge this branch: bzr merge lp:~raharper/curtin/trunk.disable_yum_plugins
Reviewer Review Type Date Requested Status
Server Team CI bot continuous-integration Approve
Chad Smith Approve
curtin developers Pending
Review via email: mp+328364@code.launchpad.net

Description of the change

Disable yum plugins when installing packages, update ca-certs for https

The default yum configured plugins includes the 'fastmirrors' plugin which
produces inconsistent results resulting in broken installs. Update the
ca-certificates package to prevent https mirror download failures. Add
some retries to the yum install commands to handle transient failures.

To post a comment you must log in.
Revision history for this message
Ryan Harper (raharper) wrote :
Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Approve (continuous-integration)
515. By Ryan Harper

Ensure yum install robustness

epel mirrorlist sometimes returns incomplete repos, attempt to ensure
install completes by upgrading ca-certificates package for https traffic
and retry the yum command 30 times.

Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Needs Fixing (continuous-integration)
516. By Ryan Harper

remove trailing whitespace

Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Approve (continuous-integration)
517. By Ryan Harper

log the captured output of yum install cmds

Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Approve (continuous-integration)
518. By Ryan Harper

add missing 'd' to log_captured parameter

Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Chad Smith (chad.smith) wrote :

+1 on this changeset. Trivial comment request inline.

Not for this proposal: I don't really understand why subp needs to have capture and log_capture params. It seems like in a subsequent branch we could drop the log_capture and just use capture to match cloud-init's subp
+1

review: Approve
519. By Ryan Harper

Update comment around yum installs for clarity around separate invocations

Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Chad Smith (chad.smith) wrote :

Strike my comment about dropping either capture/or log_captured params. Per IRC discussions I see the need for both params. Not setting capture allows us to avoid setting up buffered PIPEs when we intend to disregard the output of a command run, and there are many cases we wouldn't want to be too noisy in our logs with output of external commands for which we handle failures.

520. By Ryan Harper

merge from trunk

Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'curtin/commands/curthooks.py'
2--- curtin/commands/curthooks.py 2017-08-01 15:46:19 +0000
3+++ curtin/commands/curthooks.py 2017-08-02 17:51:07 +0000
4@@ -833,14 +833,23 @@
5 util.write_file(cloud_init_yum_repo,
6 content=cloud_init_repo(rpm_get_dist_id(target)))
7
8- # we separate the installation of epel from cloud-init as
9- # cloud-init will depend on packages included in epel and yum needs
10- # to add the repository before we can install cloud-init
11+ # we separate the installation of repository packages (epel,
12+ # cloud-init-el-release) as we need a new invocation of yum
13+ # to read the newly installed repo files.
14+ YUM_CMD = ['yum', '-y', '--noplugins', 'install']
15+ retries = [1] * 30
16 with util.ChrootableTarget(target) as in_chroot:
17- in_chroot.subp(['yum', '-y', 'install', 'epel-release'])
18- in_chroot.subp(['yum', '-y', 'install',
19- 'cloud-init-el-release'])
20- in_chroot.subp(['yum', '-y', 'install', 'cloud-init'])
21+ # ensure up-to-date ca-certificates to handle https mirror
22+ # connections
23+ in_chroot.subp(YUM_CMD + ['ca-certificates'], capture=True,
24+ log_captured=True, retries=retries)
25+ in_chroot.subp(YUM_CMD + ['epel-release'], capture=True,
26+ log_captured=True, retries=retries)
27+ in_chroot.subp(YUM_CMD + ['cloud-init-el-release'],
28+ log_captured=True, capture=True,
29+ retries=retries)
30+ in_chroot.subp(YUM_CMD + ['cloud-init'], capture=True,
31+ log_captured=True, retries=retries)
32
33 # remove cloud-init el-stable bootstrap repo config as the
34 # cloud-init-el-release package points to the correct repo
35@@ -853,7 +862,8 @@
36 capture=False, rcs=[0])
37 except util.ProcessExecutionError:
38 LOG.debug('Image missing bridge-utils package, installing')
39- in_chroot.subp(['yum', '-y', 'install', 'bridge-utils'])
40+ in_chroot.subp(YUM_CMD + ['bridge-utils'], capture=True,
41+ log_captured=True, retries=retries)
42
43 LOG.info('Passing network configuration through to target')
44 net.render_netconfig_passthrough(target, netconfig={'network': netcfg})

Subscribers

People subscribed via source and target branches