keystone charm

Giuseppe Attardi giuseppe.attardi at garr.it
Tue Nov 7 16:54:45 UTC 2017


That is already done by the mkdir imported from charmhelpers.core.host.

— Beppe

> On 07 nov 2017, at 13:06, John Meinel <john at arbash-meinel.com> wrote:
> 
> It seems like you would tend to use:
> import os
> 
> os.makedirs(os.path.dirname(config_file))
> 
> Which doesn't treat a directory that already exists as a failure.
> However, I'm guessing that there is some other expectation that the directory should be created at some other time.
> 
> John
> =:->
> 
> 
> On Tue, Nov 7, 2017 at 3:57 PM, Giuseppe Attardi <giuseppe.attardi at garr.it <mailto:giuseppe.attardi at garr.it>> wrote:
> I run into a problem when adding a unit to keystone.
> 
> The log shows this;
> 
> 2017-11-07 11:18:11 DEBUG leader-settings-changed   File "/var/lib/juju/agents/unit-keystone-ba1-cl2-14/charm/hooks/leader-settings-changed", line 675, in leader_settings_changed
> 2017-11-07 11:18:11 DEBUG leader-settings-changed     update_all_identity_relation_units()
> 2017-11-07 11:18:11 DEBUG leader-settings-changed   File "/var/lib/juju/agents/unit-keystone-ba1-cl2-14/charm/hooks/leader-settings-changed", line 353, in update_all_identity_relation_units
> 2017-11-07 11:18:11 DEBUG leader-settings-changed     CONFIGS.write_all()
> 2017-11-07 11:18:11 DEBUG leader-settings-changed   File "/var/lib/juju/agents/unit-keystone-ba1-cl2-14/charm/hooks/charmhelpers/contrib/openstack/templating.py", line 285, in write_all
> 2017-11-07 11:18:11 DEBUG leader-settings-changed     [self.write(k) for k in six.iterkeys(self.templates)]
> 2017-11-07 11:18:11 DEBUG leader-settings-changed   File "/var/lib/juju/agents/unit-keystone-ba1-cl2-14/charm/hooks/charmhelpers/contrib/openstack/templating.py", line 276, in write
> 2017-11-07 11:18:11 DEBUG leader-settings-changed     with open(config_file, 'wb') as out:
> 2017-11-07 11:18:11 DEBUG leader-settings-changed IOError: [Errno 2] No such file or directory: '/etc/keystone/keystone.conf'
> 2017-11-07 11:18:11 ERROR juju.worker.uniter.operation runhook.go:107 hook "leader-settings-changed" failed: exit status 1
> 
> and indeed the directory /etc/keystone is still missing.
> I am using Juju 2.2.4 and a variant of the keystone charm from stable/17.08.
> 
> I solved the problem by adding:
> 
>         from charmhelpers.core.host import (mkdir) # Attardi
>         mkdir(os.path.dirname(config_file)) # Attardi
> 
> in templating.py before line 276.
> Doing so should be no harm, but I wonder whether this is the right solution.
> 
> — Beppe
> 
> 
> --
> Juju mailing list
> Juju at lists.ubuntu.com <mailto:Juju at lists.ubuntu.com>
> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/juju <https://lists.ubuntu.com/mailman/listinfo/juju>
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/juju/attachments/20171107/9df8bc22/attachment.html>


More information about the Juju mailing list