Code review comment for lp://qastaging/~mew/juju-deployer/option-from-file

Revision history for this message
Adam Gandelman (gandelman-a) wrote :

Sorry for the delay. I had meant to test to use case I had in mind but haven't gotten to it yet. Looking at it again, I think this is generally okay.

I was thinking of a case where i'd like to store a passwd outside of the charm in a file, eg:

service1: {
 options: {
   user: adam
   passwd: include-file:///home/adam/.services/passwd
 }
}

and have the charm do something like:

service-manager user-create username=$(config-get username) password=$(config-get passwd)

OR

user = subprocess.check_output(['config-get', 'user'])
passwd = subprocess.check_output(['config-get', 'passwd'])
utils.manager(username=user, passwd=passwd)

I think this would be okay in both cases. The bash case would strip out newlines, anyway and the python case should probably cleaning up stdout anyway. I'll give this branch just another test one more time otherwise LGTM.

« Back to merge proposal