Merge lp:~psivaa/charms/trusty/core-image-publisher/core-worker-nopasswd into lp:~canonical-ci-engineering/charms/trusty/core-image-publisher/trunk

Proposed by Para Siva
Status: Merged
Approved by: Celso Providelo
Approved revision: 9
Merged at revision: 3
Proposed branch: lp:~psivaa/charms/trusty/core-image-publisher/core-worker-nopasswd
Merge into: lp:~canonical-ci-engineering/charms/trusty/core-image-publisher/trunk
Diff against target: 51 lines (+9/-3)
3 files modified
hooks/actions.py (+2/-3)
hooks/services.py (+3/-0)
templates/sudoers.conf (+4/-0)
To merge this branch: bzr merge lp:~psivaa/charms/trusty/core-image-publisher/core-worker-nopasswd
Reviewer Review Type Date Requested Status
Paul Larson Approve
Celso Providelo (community) Approve
Francis Ginther Approve
Review via email: mp+254413@code.launchpad.net

Commit message

Provide core-worker sudoers perm with nopasswd to run u-d-f command.

Description of the change

Provide core-worker sudoers perm with nopasswd to run u-d-f command. This also changes the ppa to the team u-service one and installs u-d-f.

To post a comment you must log in.
Revision history for this message
Paul Larson (pwlars) :
review: Needs Fixing
Revision history for this message
Celso Providelo (cprov) :
review: Needs Fixing
6. By Para Siva

Use charm helplers to render sudoers file from template

Revision history for this message
Para Siva (psivaa) wrote :

Thanks, updated accordingly.

Revision history for this message
Celso Providelo (cprov) :
review: Needs Fixing
Revision history for this message
Paul Larson (pwlars) wrote :

As noted below, agree that it's nicer to have it be just sudoers.conf as cprov recommends, and probably just drop the 77 too unless you have a good reason for it. Otherwise it looks good.

7. By Para Siva

Use sudoers.conf for the conf file

8. By Para Siva

DROP 77 now

9. By Para Siva

Use core-image-publisher

Revision history for this message
Para Siva (psivaa) wrote :

OK, those namings have been changed too. Thanks

Revision history for this message
Francis Ginther (fginther) wrote :

Looks good now.

review: Approve
Revision history for this message
Celso Providelo (cprov) wrote :

Thank you.

review: Approve
Revision history for this message
Paul Larson (pwlars) wrote :

Good work!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hooks/actions.py'
2--- hooks/actions.py 2015-03-25 04:33:46 +0000
3+++ hooks/actions.py 2015-03-27 17:43:37 +0000
4@@ -1,6 +1,5 @@
5 import base64
6 import os
7-import shutil
8 import subprocess
9
10 from charmhelpers import fetch
11@@ -11,7 +10,7 @@
12 SERVICE_NAME = 'core-image-publisher'
13 SERVICE_CONFIGNAME = 'core-service.conf'
14 REQUIRED_PACKAGES = [
15- 'python-virtualenv', 'python3-dev',
16+ 'python-virtualenv', 'python3-dev', 'ubuntu-device-flash',
17 ]
18
19 config = hookenv.config()
20@@ -33,7 +32,7 @@
21
22 def install_packages(service_name):
23 hookenv.log('Installing dependencies...')
24- fetch.add_source('ppa:canonical-ci-engineering/ci-airline-phase-0')
25+ fetch.add_source('ppa:canonical-ci-engineering/u-services')
26 fetch.configure_sources(update=True)
27 fetch.apt_install(REQUIRED_PACKAGES, fatal=True)
28
29
30=== modified file 'hooks/services.py'
31--- hooks/services.py 2015-03-25 04:13:43 +0000
32+++ hooks/services.py 2015-03-27 17:43:37 +0000
33@@ -23,6 +23,9 @@
34 helpers.render_template(
35 source='upstart.conf',
36 target='/etc/init/core-image-publisher.conf'),
37+ helpers.render_template(
38+ source='sudoers.conf',
39+ target='/etc/sudoers.d/core-image-publisher'),
40 actions.log_start,
41 ],
42 },
43
44=== added file 'templates/sudoers.conf'
45--- templates/sudoers.conf 1970-01-01 00:00:00 +0000
46+++ templates/sudoers.conf 2015-03-27 17:43:37 +0000
47@@ -0,0 +1,4 @@
48+# Specifically added for ubuntu-device-flash command for core-image-publisher
49+
50+core-worker ALL=(ALL) NOPASSWD: /usr/bin/ubuntu-device-flash
51+

Subscribers

People subscribed via source and target branches