Merge ~powersj/cloud-init:enable-snap into cloud-init:master

Proposed by Joshua Powers on 2017-03-24
Status: Merged
Merged at revision: a07f2629f0a38b6277477b0002d39400d1ea1685
Proposed branch: ~powersj/cloud-init:enable-snap
Merge into: cloud-init:master
Diff against target: 54 lines (+26/-3)
3 files modified
.gitignore (+4/-0)
setup.py (+1/-3)
snapcraft.yaml (+21/-0)
Reviewer Review Type Date Requested Status
Server Team CI bot continuous-integration Approve on 2017-04-12
Scott Moser 2017-03-24 Approve on 2017-04-12
Review via email: mp+320994@code.launchpad.net

Commit Message

snap: allows for creating cloud-init snap

Add a basic snapcraft.yaml file to allow the creation of cloud-init as
a snap. This will always pull down the latest source from master for
the snap. setup.py will now also set the default init system to be
systemd when no init system is specified.

Description of the Change

To test:

1. git clone -b enable-snap git+ssh://git.launchpad.net/~powersj/cloud-init
2. cd cloud-init
3. Because the required setup.py change is not in master, you need to edit snapcraft.yaml to use the local repo with the change. Edit parts -> cloud-init -> source as follows:
source: .
4. snapcraft
5. sudo snap install cloud-init_master_amd64.snap --classic --dangerous
--classic because it is class
--dangerous because it is not from the store and local
6. Try it out:
sudo cloud-init -v
sudo cloud-init -h

I have run a `sudo cloud-init init` and it executed as I believe is expected.

To post a comment you must log in.
~powersj/cloud-init:enable-snap updated on 2017-03-24
85f8a18... by Joshua Powers on 2017-03-24

updating LP bug #

~powersj/cloud-init:enable-snap updated on 2017-04-07
261a29b... by Joshua Powers on 2017-04-07

Make it stable and add plug for network

Scott Moser (smoser) :
review: Approve
~powersj/cloud-init:enable-snap updated on 2017-04-12
18c9a7e... by Joshua Powers on 2017-04-12

Reverting local git options

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/.gitignore b/.gitignore
2index 3946ec7..b0500a6 100644
3--- a/.gitignore
4+++ b/.gitignore
5@@ -6,3 +6,7 @@ __pycache__
6 .tox
7 .coverage
8 doc/rtd_html
9+parts
10+prime
11+stage
12+*.snap
13diff --git a/setup.py b/setup.py
14index e6693c9..32a44d9 100755
15--- a/setup.py
16+++ b/setup.py
17@@ -138,9 +138,7 @@ class InitsysInstallData(install):
18 self.init_system = self.init_system.split(",")
19
20 if len(self.init_system) == 0:
21- raise DistutilsArgError(
22- ("You must specify one of (%s) when"
23- " specifying init system(s)!") % (", ".join(INITSYS_TYPES)))
24+ self.init_system = ['systemd']
25
26 bad = [f for f in self.init_system if f not in INITSYS_TYPES]
27 if len(bad) != 0:
28diff --git a/snapcraft.yaml b/snapcraft.yaml
29new file mode 100644
30index 0000000..2328c90
31--- /dev/null
32+++ b/snapcraft.yaml
33@@ -0,0 +1,21 @@
34+name: cloud-init
35+version: master
36+summary: Init scripts for cloud instances
37+description: |
38+ Cloud instances need special scripts to run during initialisation to
39+ retrieve and install ssh keys and to let the user run various scripts.
40+
41+grade: stable
42+confinement: classic
43+
44+apps:
45+ cloud-init:
46+ # LP: #1669306
47+ command: usr/bin/python3 $SNAP/bin/cloud-init
48+ plugs: [network]
49+
50+parts:
51+ cloud-init:
52+ plugin: python
53+ source-type: git
54+ source: https://git.launchpad.net/cloud-init

Subscribers

People subscribed via source and target branches