Merge ~hloeung/ubuntu-repository-cache:fixes into ubuntu-repository-cache:master

Proposed by Haw Loeung
Status: Merged
Approved by: James Simpson
Approved revision: 25b79533aff90219ddb1d43b5f4980aa9b8614fd
Merged at revision: 66a8888233a48792caf36230b336f5de929251eb
Proposed branch: ~hloeung/ubuntu-repository-cache:fixes
Merge into: ubuntu-repository-cache:master
Diff against target: 40 lines (+27/-0)
2 files modified
hooks/hooks.py (+26/-0)
hooks/ubuntu-repository-cache-sync (+1/-0)
Reviewer Review Type Date Requested Status
James Simpson Approve
Canonical IS Reviewers Pending
Review via email: mp+429469@code.launchpad.net

Commit message

Continue to support metadata peer sync via juju-run

Description of the change

Example of breakage - https://pastebin.canonical.com/p/fGN9kHgpGp/

Testing in staging cowboying out to call juju-run - https://pastebin.canonical.com/p/THX5n2WSMR/

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
James Simpson (jsimpso) wrote :

LGTM

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

Change successfully merged at revision 66a8888233a48792caf36230b336f5de929251eb

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/hooks/hooks.py b/hooks/hooks.py
2new file mode 100755
3index 0000000..1dec48e
4--- /dev/null
5+++ b/hooks/hooks.py
6@@ -0,0 +1,26 @@
7+#!/usr/bin/env python3
8+
9+import os
10+import sys
11+
12+from charmhelpers.core import hookenv
13+
14+from lib.ubuntu_repository_cache import (
15+ metadata_peers_sync,
16+)
17+
18+LOG = hookenv.log
19+SERVICE = 'ubuntu-repository-cache'
20+
21+HOOKS = hookenv.Hooks()
22+
23+
24+@HOOKS.hook('ubuntu_repository_cache_sync')
25+def ubuntu_repository_cache_sync():
26+ environment = os.environ
27+ metadata_peers_sync.ubuntu_repository_cache_sync(environment, LOG)
28+
29+
30+if __name__ == "__main__":
31+ # execute a hook based on the name the program is called by
32+ HOOKS.execute(sys.argv)
33diff --git a/hooks/ubuntu-repository-cache-sync b/hooks/ubuntu-repository-cache-sync
34new file mode 120000
35index 0000000..9416ca6
36--- /dev/null
37+++ b/hooks/ubuntu-repository-cache-sync
38@@ -0,0 +1 @@
39+hooks.py
40\ No newline at end of file

Subscribers

People subscribed via source and target branches