Merge ~sudeephb/charm-juju-local:specify_series into charm-juju-local:master

Proposed by Sudeep Bhandari
Status: Merged
Approved by: Ramesh Sattaru
Approved revision: 214f1727c7c1ed60d9fd31c7a9f5bf79ede5a8e9
Merged at revision: e59aae36364c6a67ddef245f408d0f20220dd447
Proposed branch: ~sudeephb/charm-juju-local:specify_series
Merge into: charm-juju-local:master
Diff against target: 116 lines (+12/-30)
4 files modified
charmcraft.yaml (+1/-5)
dev/null (+0/-1)
lib/lib_charm_juju_local.py (+11/-23)
tests/tests.yaml (+0/-1)
Reviewer Review Type Date Requested Status
JamesLin Approve
Eric Chen Approve
Robert Gildein Pending
BootStack Reviewers Pending
Review via email: mp+437473@code.launchpad.net

Commit message

Make controller series same as host series

Drop Xenial 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
Eric Chen (eric-chen) wrote :

LGTM

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

Change successfully merged at revision e59aae36364c6a67ddef245f408d0f20220dd447

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/charmcraft.yaml b/charmcraft.yaml
2index 475fc6b..ac5f07b 100644
3--- a/charmcraft.yaml
4+++ b/charmcraft.yaml
5@@ -3,7 +3,7 @@ parts:
6 charm:
7 source: .
8 plugin: reactive
9- build-snaps: [charm]
10+ build-snaps: [charm/2.x/stable]
11 bases:
12 - build-on:
13 - name: ubuntu
14@@ -21,8 +21,4 @@ bases:
15 - name: ubuntu
16 channel: "18.04"
17 architectures:
18- - amd64
19- - name: ubuntu
20- channel: "16.04"
21- architectures:
22 - amd64
23\ No newline at end of file
24diff --git a/lib/lib_charm_juju_local.py b/lib/lib_charm_juju_local.py
25index e6e8a0d..39fc880 100644
26--- a/lib/lib_charm_juju_local.py
27+++ b/lib/lib_charm_juju_local.py
28@@ -36,9 +36,6 @@ class JujuLocalHelper:
29 ]
30 )
31
32- def is_xenial(self):
33- return host.lsb_release()["DISTRIB_CODENAME"] == "xenial"
34-
35 def lxd_migrate(self):
36 """Run lxd.migrate if lxd debian package is installed.
37
38@@ -49,40 +46,31 @@ class JujuLocalHelper:
39 subprocess.call("sudo lxd.migrate -yes", shell=True)
40
41 def lxd_init(self):
42- if self.is_xenial():
43- install_sh = "lxd init --auto --storage-backend dir"
44- subprocess.call(install_sh, shell=True)
45- self.render_lxd_bridge()
46- host.service_restart("lxd-bridge")
47- else:
48- # bionic or newer
49- install_sh = textwrap.dedent(
50- """
51- lxd init --auto --storage-backend dir
52- lxc network delete lxdbr0
53- lxc network create lxdbr0 ipv4.address=auto ipv6.address=none"""
54- )
55- subprocess.call(install_sh, shell=True)
56+ install_sh = textwrap.dedent(
57+ """
58+ lxd init --auto --storage-backend dir
59+ lxc network delete lxdbr0
60+ lxc network create lxdbr0 ipv4.address=auto ipv6.address=none"""
61+ )
62+ subprocess.call(install_sh, shell=True)
63
64 def setup_juju(self):
65 subprocess.call("sudo usermod -aG lxd ubuntu", shell=True)
66- if self.is_xenial():
67- aa_profile = "lxc.aa_profile"
68- else:
69- aa_profile = "lxc.apparmor.profile"
70+ aa_profile = "lxc.apparmor.profile"
71 if host.is_container():
72 subprocess.call(
73 "sudo -u ubuntu lxc profile set default "
74 "raw.lxc {}=unconfined".format(aa_profile),
75 shell=True,
76 )
77+ series = host.lsb_release()["DISTRIB_CODENAME"]
78 subprocess.call(
79 textwrap.dedent(
80- """
81+ f"""
82 sudo -u ubuntu bash <<eof
83 /snap/bin/juju clouds
84 /snap/bin/lxc network set lxdbr0 ipv6.address none
85- /snap/bin/juju bootstrap localhost lxd
86+ /snap/bin/juju bootstrap --bootstrap-series={series} localhost lxd
87 eof"""
88 ),
89 shell=True,
90diff --git a/tests/bundles/overlays/xenial.yaml.j2 b/tests/bundles/overlays/xenial.yaml.j2
91deleted file mode 100644
92index 2cfb90e..0000000
93--- a/tests/bundles/overlays/xenial.yaml.j2
94+++ /dev/null
95@@ -1 +0,0 @@
96-series: xenial
97diff --git a/tests/bundles/xenial.yaml b/tests/bundles/xenial.yaml
98deleted file mode 120000
99index f81f6ff..0000000
100--- a/tests/bundles/xenial.yaml
101+++ /dev/null
102@@ -1 +0,0 @@
103-base.yaml
104\ No newline at end of file
105diff --git a/tests/tests.yaml b/tests/tests.yaml
106index 7c9d08b..4476d69 100644
107--- a/tests/tests.yaml
108+++ b/tests/tests.yaml
109@@ -5,7 +5,6 @@ gate_bundles:
110 - jammy
111 - focal
112 - bionic
113- - xenial
114 dev_bundles:
115 - jammy
116 smoke_bundles:

Subscribers

People subscribed via source and target branches

to all changes: