Merge ~antonioromito/cloud-init:cloud-init-BZ_1673170 into cloud-init:master

Proposed by Antonio Romito
Status: Merged
Approved by: Ryan Harper
Approved revision: e8a28b7a76089aa81caedd67ff995d8a5d18ffc6
Merge reported by: Server Team CI bot
Merged at revision: not available
Proposed branch: ~antonioromito/cloud-init:cloud-init-BZ_1673170
Merge into: cloud-init:master
Diff against target: 23 lines (+5/-4)
1 file modified
cloudinit/cmd/main.py (+5/-4)
Reviewer Review Type Date Requested Status
Server Team CI bot continuous-integration Approve
Ryan Harper Approve
Dan Watkins Needs Information
Review via email: mp+362884@code.launchpad.net

Commit message

cmd:main.py: Fix missing 'modules-init' key in modes dict

Cloud-init's main.py will fail when presented with a new
stage name 'modules-init' if upgrading an older cloud-init.
Fix this by initializing unknown stage names before accessing.

LP: #1815109

To post a comment you must log in.
Revision history for this message
Server Team CI bot (server-team-bot) wrote :

PASSED: Continuous integration, rev:2b2588e7168ef0fa2661bb99b136d3e322d56b5d
https://jenkins.ubuntu.com/server/job/cloud-init-ci/559/
Executed test runs:
    SUCCESS: Checkout
    SUCCESS: Unit & Style Tests
    SUCCESS: Ubuntu LTS: Build
    SUCCESS: Ubuntu LTS: Integration
    IN_PROGRESS: Declarative: Post Actions

Click here to trigger a rebuild:
https://jenkins.ubuntu.com/server/job/cloud-init-ci/559/rebuild

review: Approve (continuous-integration)
Revision history for this message
Antonio Romito (antonioromito) wrote :

Found the root cause.

Better to go for the following solution:

# diff /usr/lib/python2.7/site-packages/cloudinit/cmd/main.py.orig /usr/lib/python2.7/site-packages/cloudinit/cmd/main.py
643,644c643,646
< elif mode not in status['v1']:
< status['v1'][mode] = nullstatus.copy()
---
> else:
> for m in modes:
> if m not in status['v1']:
> status['v1'][m] = nullstatus.copy()

Revision history for this message
Dan Watkins (oddbloke) :
review: Needs Information
Revision history for this message
Antonio Romito (antonioromito) wrote :

Probably the description of what the issue is can be found at: https://access.redhat.com/solutions/3896071

Revision history for this message
Dan Watkins (oddbloke) :
Revision history for this message
Server Team CI bot (server-team-bot) wrote :

FAILED: Continuous integration, rev:e9fab8a5cd8d7537deaa23a03c229d54e459e8a3
https://jenkins.ubuntu.com/server/job/cloud-init-ci/656/
Executed test runs:
    SUCCESS: Checkout
    FAILED: Unit & Style Tests

Click here to trigger a rebuild:
https://jenkins.ubuntu.com/server/job/cloud-init-ci/656/rebuild

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

PASSED: Continuous integration, rev:e8a28b7a76089aa81caedd67ff995d8a5d18ffc6
https://jenkins.ubuntu.com/server/job/cloud-init-ci/657/
Executed test runs:
    SUCCESS: Checkout
    SUCCESS: Unit & Style Tests
    SUCCESS: Ubuntu LTS: Build
    SUCCESS: Ubuntu LTS: Integration
    IN_PROGRESS: Declarative: Post Actions

Click here to trigger a rebuild:
https://jenkins.ubuntu.com/server/job/cloud-init-ci/657/rebuild

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

FAILED: Autolanding.
More details in the following jenkins job:
https://jenkins.ubuntu.com/server/job/cloud-init-autoland-test/211/
Executed test runs:
    SUCCESS: Checkout
    SUCCESS: Unit & Style Tests
    SUCCESS: Ubuntu LTS: Build
    FAILED: Ubuntu LTS: Integration

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

The autolander didn't like some of the UTF-8 chars in the commit message. I've updated the commit message to summarize the finding and remove the UTF-8 chars (we'll fix the autolander as well).

This should get things going again.

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/cloudinit/cmd/main.py b/cloudinit/cmd/main.py
2index 933c019..a5446da 100644
3--- a/cloudinit/cmd/main.py
4+++ b/cloudinit/cmd/main.py
5@@ -632,13 +632,14 @@ def status_wrapper(name, args, data_d=None, link_d=None):
6 'start': None,
7 'finished': None,
8 }
9+
10 if status is None:
11 status = {'v1': {}}
12- for m in modes:
13- status['v1'][m] = nullstatus.copy()
14 status['v1']['datasource'] = None
15- elif mode not in status['v1']:
16- status['v1'][mode] = nullstatus.copy()
17+
18+ for m in modes:
19+ if m not in status['v1']:
20+ status['v1'][m] = nullstatus.copy()
21
22 v1 = status['v1']
23 v1['stage'] = mode

Subscribers

People subscribed via source and target branches