Merge lp:~ltrager/maas-images/lp1791189 into lp:maas-images

Proposed by Lee Trager
Status: Merged
Merged at revision: 409
Proposed branch: lp:~ltrager/maas-images/lp1791189
Merge into: lp:maas-images
Prerequisite: lp:~ltrager/maas-images/add_missing_centos_packages
Diff against target: 26 lines (+9/-0)
1 file modified
curtin/centos7/finalize.py (+9/-0)
To merge this branch: bzr merge lp:~ltrager/maas-images/lp1791189
Reviewer Review Type Date Requested Status
Scott Moser (community) Approve
Review via email: mp+354842@code.launchpad.net

Commit message

Centos7: do not run finalize hook if curtin supports centos.

If curtin has the feature CENTOS_CURTHOOK_SUPPORT, then do not run
the 'finalize' hook, but let curtin handle it.

The finalize CentOS hook writes the MAAS OAUTH credentials to
90_datasource.cfg. The builtin Curtin hooks are writing the MAAS OAUTH
credentials to 50-cloudconfig-maas-reporting.cfg. Disable the finalize
hook when Curtin supports CENTOS_CURTHOOK_SUPPORT to avoid duplicated
data.

To post a comment you must log in.
Revision history for this message
Scott Moser (smoser) wrote :

i re-formatted your description to be 74 chars wide and re-worded the subject line a bit.

please use that hwen you land and feel free to do so.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'curtin/centos7/finalize.py'
2--- curtin/centos7/finalize.py 2016-05-11 18:47:46 +0000
3+++ curtin/centos7/finalize.py 2018-09-13 08:14:17 +0000
4@@ -11,6 +11,10 @@
5 import sys
6
7 from curtin import util
8+try:
9+ from curtin import FEATURES as curtin_features
10+except ImportError:
11+ curtin_features = []
12
13
14 DATASOURCE_LIST = """\
15@@ -74,6 +78,11 @@
16
17
18 def main():
19+ # The builtin Curtin hooks handle writing the datasource as
20+ # 50-cloudconfig-maas-reporting.cfg. Running this creates duplicated data
21+ # at 90_datasource.cfg.
22+ if 'CENTOS_CURTHOOK_SUPPORT' in curtin_features:
23+ return
24 state = util.load_command_environment()
25 target = state['target']
26 if target is None:

Subscribers

People subscribed via source and target branches