Merge ~hloeung/container-log-archive-charm:master into container-log-archive-charm:master

Proposed by Haw Loeung
Status: Merged
Approved by: Haw Loeung
Approved revision: a5acdbf6c41c2b28645130a141bff2176d45f1aa
Merged at revision: b874095cf7070027b2a63e318ab4a48871d78b16
Proposed branch: ~hloeung/container-log-archive-charm:master
Merge into: container-log-archive-charm:master
Prerequisite: ~hloeung/container-log-archive-charm:charm-helpers-sync
Diff against target: 76 lines (+12/-7)
3 files modified
files/check-log-archive-status (+8/-4)
metadata.yaml (+1/-0)
scripts/charm_helpers_sync.py (+3/-3)
Reviewer Review Type Date Requested Status
Paul Collins Approve
Canonical IS Reviewers Pending
Review via email: mp+387403@code.launchpad.net

Commit message

python3-ify for Focal support

To post a comment you must log in.
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

This merge proposal is being monitored by mergebot. Change the status to Approved to merge.

Revision history for this message
Paul Collins (pjdc) wrote :

Land at will.

review: Approve
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

Change successfully merged at revision b874095cf7070027b2a63e318ab4a48871d78b16

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/files/check-log-archive-status b/files/check-log-archive-status
2index 305741e..5aedb84 100755
3--- a/files/check-log-archive-status
4+++ b/files/check-log-archive-status
5@@ -1,4 +1,4 @@
6-#!/usr/bin/python
7+#!/usr/bin/python3
8 #
9 # Check the status of the last container-log-archive run
10
11@@ -6,18 +6,22 @@ import sys
12 import os.path
13 import datetime
14
15+
16 def critical(msg):
17- print "CRITICAL: " + msg
18+ print("CRITICAL: " + msg)
19 sys.exit(2)
20
21+
22 def warning(msg):
23- print "WARNING: " + msg
24+ print("WARNING: " + msg)
25 sys.exit(1)
26
27+
28 def ok(msg):
29- print "OK: " + msg
30+ print("OK: " + msg)
31 sys.exit(0)
32
33+
34 try:
35 status_file = sys.argv[1]
36 except IndexError:
37diff --git a/metadata.yaml b/metadata.yaml
38index a74e46f..276a1aa 100644
39--- a/metadata.yaml
40+++ b/metadata.yaml
41@@ -7,6 +7,7 @@ description: |
42 series:
43 - xenial
44 - bionic
45+ - focal
46 tags:
47 - miscellaneous
48 subordinate: true
49diff --git a/scripts/charm_helpers_sync.py b/scripts/charm_helpers_sync.py
50index b5e7d95..87b422b 100755
51--- a/scripts/charm_helpers_sync.py
52+++ b/scripts/charm_helpers_sync.py
53@@ -1,4 +1,4 @@
54-#!/usr/bin/env python
55+#!/usr/bin/env python3
56 # Copyright 2013 Canonical Ltd.
57
58 # Authors:
59@@ -22,7 +22,7 @@ def parse_config(conf_file):
60 if not os.path.isfile(conf_file):
61 logging.error('Invalid config file: %s.' % conf_file)
62 return False
63- return yaml.load(open(conf_file).read())
64+ return yaml.safe_load(open(conf_file).read())
65
66
67 def clone_helpers(work_dir, branch):
68@@ -215,7 +215,7 @@ if __name__ == '__main__':
69 checkout = clone_helpers(tmpd, config['branch'])
70 sync_helpers(config['include'], checkout, config['destination'],
71 options=sync_options)
72- except Exception, e:
73+ except Exception as e:
74 logging.error("Could not sync: %s" % e)
75 raise e
76 finally:

Subscribers

People subscribed via source and target branches