Merge ~jamesh5979/glance-sync-master-layer:master into ~woutervb/glance-sync-master-layer:master

Proposed by James Hilling
Status: Needs review
Proposed branch: ~jamesh5979/glance-sync-master-layer:master
Merge into: ~woutervb/glance-sync-master-layer:master
Diff against target: 134 lines (+17/-13)
3 files modified
config.yaml (+4/-0)
reactive/glance-sync-master.py (+12/-12)
tests/30-glance-sync-master (+1/-1)
Reviewer Review Type Date Requested Status
Legacy - Canonical WTFB Pending
Review via email: mp+359961@code.launchpad.net

Commit message

[j.hilling] fix: re-added 'admin_email' within config.yaml

Description of the change

Missing 'admin_email' option within config.yaml. This `juju config` option was removed from the config.yaml file in a previous commit.

The cronjob that is part of this charm requires that this option exists, so that the 'MAILTO' variable within the cronjob can be populated with an email address.

Effect: stops images from syncing.

To post a comment you must log in.

Unmerged commits

972b67f... by James Hilling

fix: re-added 'admin_email' within config.yaml

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/config.yaml b/config.yaml
2index 9007d0a..fee94ea 100755
3--- a/config.yaml
4+++ b/config.yaml
5@@ -1,4 +1,8 @@
6 options:
7+ admin_email:
8+ default: "root@canonical.com"
9+ description: email address for notifications
10+ type: string
11 config_dir:
12 default: /srv/glance_sync_master/config
13 description: directory to store configuration like novarc
14diff --git a/reactive/glance-sync-master.py b/reactive/glance-sync-master.py
15index 9bb56b0..cbb7d5f 100644
16--- a/reactive/glance-sync-master.py
17+++ b/reactive/glance-sync-master.py
18@@ -44,7 +44,7 @@ def install_glance_sync_master():
19
20 open_port(22, protocol='TCP')
21 set_state('glance-sync-master.installed')
22- hookenv.status_set('active', 'Unit ready')
23+ hookenv.status_set('active', 'Unit is ready')
24
25
26 @hook('upgrade-charm')
27@@ -63,7 +63,7 @@ def configure_config_dir():
28 pwd.getpwnam('ubuntu').pw_uid,
29 grp.getgrnam('ubuntu').gr_gid)
30 configure_cron()
31- hookenv.status_set('active', 'Unit ready')
32+ hookenv.status_set('active', 'Unit is ready')
33
34
35 @when('config.changed.data_dir')
36@@ -77,7 +77,7 @@ def configure_data_dir():
37 pwd.getpwnam('ubuntu').pw_uid,
38 grp.getgrnam('ubuntu').gr_gid)
39 configure_cron()
40- hookenv.status_set('active', 'Unit ready')
41+ hookenv.status_set('active', 'Unit is ready')
42
43
44 @when('config.changed.log_dir')
45@@ -97,7 +97,7 @@ def configure_log_dir():
46 perms=0o644,
47 context=hookenv.config())
48 configure_cron()
49- hookenv.status_set('active', 'Unit ready')
50+ hookenv.status_set('active', 'Unit is ready')
51
52
53 @when('config.changed.script_dir')
54@@ -112,7 +112,7 @@ def configure_script_dir():
55 install_sync_script()
56 install_db_cleanup_script()
57 configure_cron()
58- hookenv.status_set('active', 'Unit ready')
59+ hookenv.status_set('active', 'Unit is ready')
60
61
62 @when('config.changed.authorized_keys')
63@@ -140,11 +140,11 @@ def configure_authorized_keys():
64
65 configure_sshd(auth_keys_file)
66
67- hookenv.status_set('active', 'Unit ready')
68+ hookenv.status_set('active', 'Unit is ready')
69 else:
70 if os.path.isfile(auth_keys_file):
71 os.remove(auth_keys_file)
72- hookenv.status_set('active', 'Unit ready')
73+ hookenv.status_set('active', 'Unit is ready')
74
75
76 # Adds an AutorizedKeysFile line to /etc/ssh/sshd_config
77@@ -214,7 +214,7 @@ def install_sync_script():
78 grp.getgrnam('ubuntu').gr_gid)
79 os.chmod(dest, 0o640)
80
81- hookenv.status_set('active', 'Unit ready')
82+ hookenv.status_set('active', 'Unit is ready')
83
84
85 def install_db_cleanup_script():
86@@ -229,7 +229,7 @@ def install_db_cleanup_script():
87 pwd.getpwnam('ubuntu').pw_uid,
88 grp.getgrnam('ubuntu').gr_gid)
89 os.chmod(dest, 0o740)
90- hookenv.status_set('active', 'Unit ready')
91+ hookenv.status_set('active', 'Unit is ready')
92
93
94 @when('config.changed.novarc')
95@@ -296,7 +296,7 @@ def write_relation_novarc(path):
96 owner='ubuntu',
97 perms=0o600,
98 context=context)
99- hookenv.status_set('active', 'Unit ready')
100+ hookenv.status_set('active', 'Unit is ready')
101 elif 'db' not in context.keys():
102 hookenv.status_set('maintenance', 'mysql relation incomplete')
103 elif 'keystone' not in context.keys():
104@@ -327,7 +327,7 @@ def configure_cron():
105 if os.path.isfile(cron_file):
106 os.remove(cron_file)
107 remove_state('cron.configured')
108- hookenv.status_set('active', 'Unit ready')
109+ hookenv.status_set('active', 'Unit is ready')
110
111
112 @hook('nrpe-external-master-relation-changed')
113@@ -373,7 +373,7 @@ def setup_nrpe_checks(nagios):
114 context=config['nagios_context'],
115 unit=hookenv.local_unit())
116
117- hookenv.status_set('active', 'Unit ready')
118+ hookenv.status_set('active', 'Unit is ready')
119
120
121 @when('config.changed.trusted_ssl_ca')
122diff --git a/tests/30-glance-sync-master b/tests/30-glance-sync-master
123index 74f745b..34f7b5f 100755
124--- a/tests/30-glance-sync-master
125+++ b/tests/30-glance-sync-master
126@@ -250,7 +250,7 @@ class TestDeployment(unittest.TestCase):
127 self.d.configure('glance-sync-master', {'sync_enabled': False})
128 time.sleep(10)
129 # self.d.sentry.wait()
130- self.d.sentry.wait_for_messages({'glance-sync-master': 'Unit ready'})
131+ self.d.sentry.wait_for_messages({'glance-sync-master': 'Unit is ready'})
132
133 verify_commands = ['test ! -e {}'.format(cron_file)]
134 self.run_commands(verify_commands)

Subscribers

People subscribed via source and target branches