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
diff --git a/charmcraft.yaml b/charmcraft.yaml
index 475fc6b..ac5f07b 100644
--- a/charmcraft.yaml
+++ b/charmcraft.yaml
@@ -3,7 +3,7 @@ parts:
3 charm:3 charm:
4 source: .4 source: .
5 plugin: reactive5 plugin: reactive
6 build-snaps: [charm]6 build-snaps: [charm/2.x/stable]
7bases:7bases:
8 - build-on:8 - build-on:
9 - name: ubuntu9 - name: ubuntu
@@ -21,8 +21,4 @@ bases:
21 - name: ubuntu21 - name: ubuntu
22 channel: "18.04"22 channel: "18.04"
23 architectures:23 architectures:
24 - amd64
25 - name: ubuntu
26 channel: "16.04"
27 architectures:
28 - amd6424 - amd64
29\ No newline at end of file25\ No newline at end of file
diff --git a/lib/lib_charm_juju_local.py b/lib/lib_charm_juju_local.py
index e6e8a0d..39fc880 100644
--- a/lib/lib_charm_juju_local.py
+++ b/lib/lib_charm_juju_local.py
@@ -36,9 +36,6 @@ class JujuLocalHelper:
36 ]36 ]
37 )37 )
3838
39 def is_xenial(self):
40 return host.lsb_release()["DISTRIB_CODENAME"] == "xenial"
41
42 def lxd_migrate(self):39 def lxd_migrate(self):
43 """Run lxd.migrate if lxd debian package is installed.40 """Run lxd.migrate if lxd debian package is installed.
4441
@@ -49,40 +46,31 @@ class JujuLocalHelper:
49 subprocess.call("sudo lxd.migrate -yes", shell=True)46 subprocess.call("sudo lxd.migrate -yes", shell=True)
5047
51 def lxd_init(self):48 def lxd_init(self):
52 if self.is_xenial():49 install_sh = textwrap.dedent(
53 install_sh = "lxd init --auto --storage-backend dir"50 """
54 subprocess.call(install_sh, shell=True)51 lxd init --auto --storage-backend dir
55 self.render_lxd_bridge()52 lxc network delete lxdbr0
56 host.service_restart("lxd-bridge")53 lxc network create lxdbr0 ipv4.address=auto ipv6.address=none"""
57 else:54 )
58 # bionic or newer55 subprocess.call(install_sh, shell=True)
59 install_sh = textwrap.dedent(
60 """
61 lxd init --auto --storage-backend dir
62 lxc network delete lxdbr0
63 lxc network create lxdbr0 ipv4.address=auto ipv6.address=none"""
64 )
65 subprocess.call(install_sh, shell=True)
6656
67 def setup_juju(self):57 def setup_juju(self):
68 subprocess.call("sudo usermod -aG lxd ubuntu", shell=True)58 subprocess.call("sudo usermod -aG lxd ubuntu", shell=True)
69 if self.is_xenial():59 aa_profile = "lxc.apparmor.profile"
70 aa_profile = "lxc.aa_profile"
71 else:
72 aa_profile = "lxc.apparmor.profile"
73 if host.is_container():60 if host.is_container():
74 subprocess.call(61 subprocess.call(
75 "sudo -u ubuntu lxc profile set default "62 "sudo -u ubuntu lxc profile set default "
76 "raw.lxc {}=unconfined".format(aa_profile),63 "raw.lxc {}=unconfined".format(aa_profile),
77 shell=True,64 shell=True,
78 )65 )
66 series = host.lsb_release()["DISTRIB_CODENAME"]
79 subprocess.call(67 subprocess.call(
80 textwrap.dedent(68 textwrap.dedent(
81 """69 f"""
82 sudo -u ubuntu bash <<eof70 sudo -u ubuntu bash <<eof
83 /snap/bin/juju clouds71 /snap/bin/juju clouds
84 /snap/bin/lxc network set lxdbr0 ipv6.address none72 /snap/bin/lxc network set lxdbr0 ipv6.address none
85 /snap/bin/juju bootstrap localhost lxd73 /snap/bin/juju bootstrap --bootstrap-series={series} localhost lxd
86 eof"""74 eof"""
87 ),75 ),
88 shell=True,76 shell=True,
diff --git a/tests/bundles/overlays/xenial.yaml.j2 b/tests/bundles/overlays/xenial.yaml.j2
89deleted file mode 10064477deleted file mode 100644
index 2cfb90e..0000000
--- a/tests/bundles/overlays/xenial.yaml.j2
+++ /dev/null
@@ -1 +0,0 @@
1series: xenial
diff --git a/tests/bundles/xenial.yaml b/tests/bundles/xenial.yaml
2deleted file mode 1200000deleted file mode 120000
index f81f6ff..0000000
--- a/tests/bundles/xenial.yaml
+++ /dev/null
@@ -1 +0,0 @@
1base.yaml
2\ No newline at end of file0\ No newline at end of file
diff --git a/tests/tests.yaml b/tests/tests.yaml
index 7c9d08b..4476d69 100644
--- a/tests/tests.yaml
+++ b/tests/tests.yaml
@@ -5,7 +5,6 @@ gate_bundles:
5 - jammy5 - jammy
6 - focal6 - focal
7 - bionic7 - bionic
8 - xenial
9dev_bundles:8dev_bundles:
10 - jammy9 - jammy
11smoke_bundles:10smoke_bundles:

Subscribers

People subscribed via source and target branches

to all changes: