Merge lp:~cmisare/turku-charms/turku-agent-charm into lp:turku-charms/turku-agent-charm

Proposed by Colin Misare
Status: Merged
Approved by: Benjamin Allot
Approved revision: 17
Merged at revision: 17
Proposed branch: lp:~cmisare/turku-charms/turku-agent-charm
Merge into: lp:turku-charms/turku-agent-charm
Diff against target: 15 lines (+3/-2)
1 file modified
hooks/hooks.py (+3/-2)
To merge this branch: bzr merge lp:~cmisare/turku-charms/turku-agent-charm
Reviewer Review Type Date Requested Status
Benjamin Allot Approve
Review via email: mp+409277@code.launchpad.net

Commit message

Work-around for systems with no upstart (missing /etc/init)

Description of the change

When using the turku-agent-charm on a bionic (18.04.6) series, the install hook fails because of a missing /etc/init directory:

unit-turku-agent-1: 16:43:04 INFO unit.turku-agent/1.juju-log Hook: install
unit-turku-agent-1: 16:43:06 WARNING unit.turku-agent/1.install zip_safe flag not set; analyzing archive contents...
unit-turku-agent-1: 16:43:07 WARNING unit.turku-agent/1.install Traceback (most recent call last):
unit-turku-agent-1: 16:43:07 WARNING unit.turku-agent/1.install File "/var/lib/juju/agents/unit-turku-agent-1/charm/hooks/install", line 148, in <module>
unit-turku-agent-1: 16:43:07 WARNING unit.turku-agent/1.install install()
unit-turku-agent-1: 16:43:07 WARNING unit.turku-agent/1.install File "/var/lib/juju/agents/unit-turku-agent-1/charm/hooks/install", line 48, in install
unit-turku-agent-1: 16:43:07 WARNING unit.turku-agent/1.install '/etc/init/turku-agent-rsyncd.conf')
unit-turku-agent-1: 16:43:07 WARNING unit.turku-agent/1.install File "/usr/lib/python3.6/shutil.py", line 121, in copyfile
unit-turku-agent-1: 16:43:07 WARNING unit.turku-agent/1.install with open(dst, 'wb') as fdst:
unit-turku-agent-1: 16:43:07 WARNING unit.turku-agent/1.install FileNotFoundError: [Errno 2] No such file or directory: '/etc/init/turku-agent-rsyncd.conf'
unit-turku-agent-1: 16:43:07 ERROR juju.worker.uniter.operation hook "install" (via explicit, bespoke hook script) failed: exit status 1

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
Benjamin Allot (ballot) wrote :

LGTM

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

Change successfully merged at revision 17

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hooks/hooks.py'
2--- hooks/hooks.py 2019-07-17 18:04:16 +0000
3+++ hooks/hooks.py 2021-09-28 08:56:44 +0000
4@@ -44,8 +44,9 @@
5 '/etc/cron.d/turku-agent')
6
7 # Upstart configuration
8- shutil.copyfile('files/turku-agent/turku-agent-rsyncd.conf',
9- '/etc/init/turku-agent-rsyncd.conf')
10+ if os.path.isdir('/etc/init'):
11+ shutil.copyfile('files/turku-agent/turku-agent-rsyncd.conf',
12+ '/etc/init/turku-agent-rsyncd.conf')
13
14 # Systemd configuration
15 if os.path.isdir('/etc/systemd/system'):

Subscribers

People subscribed via source and target branches

to all changes: