/srv/irclogs.ubuntu.com/2017/10/03/#juju.txt

erik_lonrothrick_h: Did you write this? http://mitechie.com/blog/2017/9/28/learning-to-speak-juju07:05
zeestraterik_lonroth: Yeah, that's Rick.07:24
erik_lonrothits super!07:26
rick_herik_lonroth: thank you10:50
rick_herik_lonroth: zeestrat please make sure to share it along.10:54
ed____hi there :) does anyone know the right way to get rid of a machine that's in error state where provisioning can't match a suitable machine because of constraints? I want to back out of adding one machine manually! (oops)12:54
rick_hed____: you should be able to juju destroy-machine --force13:14
ed____thank you Rick, I'll give it a try13:31
ed____yay :) it worked. Thank you Rick13:39
rick_hnp ed____13:40
skaydoes anyone have a wsgi-layer that can deal with python 2 wsgi apps? There's https://github.com/canonical-webteam/layer-wsgi for python313:40
skayI like the idea of using a wsgi layer, but I can't upgrade my application right now13:41
rick_hskay: hmm, might be tough. I'm not sure if bdx has anything as he was doing some django bits but I don't know if it was py2 or py313:44
rick_hskay: can you crib enough to make the layer-wsgi py2 compatible?13:44
skayrick_h: I was wondering about that. would anyone other than me find it valuable?13:44
rick_hskay: always default to "yes" on that one :P13:45
skayhaha13:45
rick_hskay: you're not so special as to be the only one doing it hehe13:45
rick_hjust the only one asking about it out loud13:45
skayrick_h: I'm currently upgrading a django project from 1.6 to 1.11 so I have enough to deal with than to get it on python 3 /o\13:46
skay:(13:46
skay;_; cry13:46
rick_hskay: hah, yea the MAAS folks I know had to put some big time into that move13:46
skayrick_h: oh hey, have of them written an epic of their journey past 1.6 and deployment gotchas?13:47
skayI've been thinking about how to do that, and wondering if I should just make a one-off deployment to get from 1.6 to 1.7 and subsequently do normal stuff13:48
rick_hskay: hmm, not sure. I thought I've got something tickling my brain but can't find anything off the top of my head.13:48
bdxskay, I've traced those trails ... it really helps if you are familiar with the big changes going into 1.11 (e.g write/deploy some small app in 1.11 before you do the port just so you are familiar with the changes)13:48
bdxalso13:48
bdxskay, https://github.com/jamesbeedy/layer-django-base/blob/master/templates/django-gunicorn.service.tmpl13:48
skaybdx: I'm thinking for now I might get to 1.8 first, even though it ends next year13:49
bdxi use that^ works for python 2 or 313:49
skaybdx: thanks13:49
rick_hskay: yea, I'm pretty sure maas took that route13:49
skayI'll take a look13:49
rick_hbdx: http://mitechie.com/blog/2017/9/28/learning-to-speak-juju for ya13:49
rick_hplease spread far and wide :)13:49
rick_hwill get it on insights in another couple of hours but I think it looks better on my blog :)13:50
bdxskay, heres the simple handler that writes it out https://github.com/jamesbeedy/layer-django-base/blob/master/reactive/django_base.py#L237,L24713:50
skayalso, I inherited a juju1 charm written in bash that was from ages yore13:50
bdxrick_h: that is beautiful13:50
skayso basically I would like to dump it13:50
rick_hskay: ouch yea that's not really a migration but a rewrite there13:51
* skay nods, sadly13:51
bdxskay: you found an artifact for the juju museum?13:53
skayif not that, then the juju hospice13:53
bdxskay: lets get you a fresh new juju 2 version and send that bad boy to the grave13:54
skaybdx: small comment. you have mutable args, and that is a gotcha. https://github.com/jamesbeedy/layer-django-base/blob/master/lib/charms/layer/django_base.py#L12114:24
skayhttp://docs.python-guide.org/en/latest/writing/gotchas/#mutable-default-arguments14:25
bdxthat function is a dangler, I shoudl remove it14:26
bdxbut thanks for the heads up on that14:26
skayyeah, I noticed it has a note for not used14:27
skaywasn't sure if it will be used in the future, etc14:27
skayanyway, scrub elsewhere too. I just noticed it in render_settings_py14:27
skaythat gotcha bit me a while back14:28
bdxIm not sure I see the issue14:28
bdxthying to grok that ^ link now14:28
bdxahh I see "This means that if you use a mutable default argument and mutate it, you will and have mutated that object for all future calls to the function as well."14:30
skayI think you may be okay since you are not mutating secrets unless I missed it14:31
skaybut it's better never to use a mutable arg14:31
bdxyeah, Im see that14:31
bdxok, well nice little wake up call14:31
bdxthanks @skay14:31
bdxI can go fix all my code now14:31
bdxI'm sure I have that everywhere14:32
bdxshoots14:32
bdxlol14:32
skayhaha14:32
rick_hOSS ftw :)14:32
bdxskay: thanks again for pointing those out, I fixed up those in the django-base-layer14:40
skaybdx: this is handy. I'm learning about actions.14:59
bdxskay, yeah that update-app action comes in really handy for sure14:59
skaybdx: also, I may have a small PR to tidy something. for gen_short_sha_for_current_comment you could use git rev-parse --short HEAD, so perhaps you could merely pass a short=True to the other method. any objection/comment?14:59
skaybdx: it's not critical.15:00
bdxskay: those django layers are new, I'm working on them daily - would gladly accept pull requests15:01
bdxskay: theres a lot of ground to cover with django .... its so open ended that it makes making an opinionated charm difficult15:01
bdxbut my basic goal is to come up with some best practices for making it more extensible15:02
bdxthe settings files are one thing15:02
bdxthe way I have a separate file for each thing, then the templates/settings.py.tmpl has to track those imports15:03
bdxat the bottom15:03
bdxI think a better way would be to write all juju generated settings files to a "juju_django_settings/" directory15:04
bdxthen glob all the files *.py in that dir15:04
bdxor something to that affect15:04
bdxskay: I'm working on getting a protocol going for things like that15:05
bdxbut yeah, send some me prs15:05
skaybdx: do you need the long git sha for any reason? perhaps just use the short one all the time15:07
bdxyeah, so thats kind of a personal thing we can remove15:07
bdxI use to like to have a REVISION file in my project root15:07
bdxthat contained the full sha15:07
bdxit just kind of became a practice of mine a worked its way into the charm15:08
skayI've got a thing that runs bzr revno (actually it's in that old charm)15:08
bdxI dont really use it anymore, and its just hanging out, so we can nix it15:08
skayso I know what you mean I think15:08
skayhey, it's informative15:08
skayat least keep the log line15:09
=== rogpeppe1 is now known as rogpeppe
zeestratHey rick_h, what's the status on getting bash autocompletion for snapped juju?18:31
rick_hzeestrat: not sure. balloons  any insight?18:32
skayrick_h: oh hey, you still around? how bad is this approach? I don't like it but if something like this works to support python2 use then I might suggest it https://github.com/codersquid/layer-wsgi/commit/448ba8d669f87328ee36512ba57c9cb2b3d8671319:01
skayrick_h: also, charmhelpers contrib has python package support, but with a limited set of options, so I can see why this layer is not using it19:03
balloonszeestrat, it's already there19:11
balloonszeestrat, it should be working for you19:11
* rick_h uses zsh and missed it was working doh19:14
balloonsrick_h, ahh.. well snap is landing support for all shells bash completion, we can 'upgrade' the snap to include support once it lands19:21
zeestratballoons: Is there a trick to it with environment variables or something? Can't seem to get it to work on a clean 14.04 or 16.04 vm after "sudo snap install juju --classic". Tried logging in and out. snap version on both is 2.27.619:36
balloonszeestrat, bash completion is a bit wonky honestly19:36
balloonszeestrat, I have had to source the completion script manually or ensure bash-completion is installed and running19:37
balloonsit's /etc/bash_completion and /usr/share/bash-completion/completions/juju19:38
zeestratballoons: Ah, installing bash-completion and relogging did the trick. That should be documented somewhere.19:38
balloonsright, if you don't have bash completion, it won't work :-)19:39
zeestratrick_h: Regarding https://github.com/juju/charmstore/issues/774, adding some extra-info to the charm store seems to be easy enough, but are there any fields that will be displayed on jujucharms.com? There used to be a revision box but I can't find that anymore.20:47
rick_hzeestrat: no, only the homepage and bugs url are shown.20:47
zeestratrick_h: Alright. Is that a hard rule or can I put in a request somewhere?20:50
rick_hzeestrat: you can ask, what are you thinking?20:50
zeestratrick_h: Was thinking about a commit tag or hash as mentioned in the issue.20:52
zeestratrick_h: If I'm reading the issue correctly, that seems to be what the submitter is asking for to.21:06

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!