/srv/irclogs.ubuntu.com/2015/12/14/#juju.txt

=== wolsen_ is now known as wolsen
=== verterok is now known as verterok-away
=== JoshStrobl is now known as JoshStrobl|AFK
icezimmhi guys, I'm trying to install openstack using autopilot and when juju is going to install landscape server, I'm with a lot of messages like this 'machine-0: 2015-12-14 13:25:12 WARNING juju.state allwatcher.go:355 getting a private address for unit "landscape-server/0" failed: "private no address"', for private and public address.. if someone could point me on the direction of fixing this, I do really appreciate, thank you :)13:36
icezimmsorry about using guys, hello everybody :)13:38
lazypowericezimm: which version of Juju? 1.25 i assume?13:39
jamespagegnuoy`, I think logging options could push down into the base layer13:48
jamespagethey are common across principle and subordinate charms I think13:48
gnuoy`ack13:49
icezimmlazypower: exactly, 1.25.0-wily-amd6413:54
lazypowericezimm: interesting, when you provision a node with maas/juju - do you see the same error output that it's unable to find the public/private addressing of the unit? or is it only that one node in maas?13:58
icezimmlazypower: don't know exactly, I'm really new to this… I'm following the instructions here: http://www.ubuntu.com/download/cloud/install-openstack-with-autopilot14:04
lazypowericezimm: try destroying the juju environment `juju destroy-environment maas` and then stand it backup with `juju bootstrap` and try `juju deploy ubuntu`14:04
lazypowericezimm: once you've done juju deploy ubuntu, tail the logs while the unit provisions - `juju debug-log`14:05
lazypowericezimm: i'm also making the assumption you've got nothing else in the environment, so you're free to nuke whats there and start from scratch14:05
icezimmlazypower: I have this config.yaml and running the command on install.sh https://gist.github.com/fernandes/e055827d8ef8c9715a5414:06
icezimmsure, I'm using these machines as tests… can nuke without any problem14:06
icezimmERROR cannot read environment info: environment "maas" not found14:07
icezimm~/.cloud-install/juju/environments/ is empty14:08
icezimmexport JUJU_HOME=~/.cloud-install/juju14:09
icezimmand now its bootstrapping14:09
icezimmafter bootstrap14:16
icezimmBootstrap agent installed14:16
icezimmWARNING expected one instance, got 214:16
icezimmWaiting for API to become available14:16
icezimmBootstrap complete14:16
icezimmjust this warning, but bootstrap ok14:16
lazypowericezimm: so far so good14:17
icezimmI'm watching the juju/all-machines.log14:17
icezimmlazypower: https://gist.github.com/fernandes/e055827d8ef8c9715a54#file-all-machines-log14:18
icezimmin case can help debugging something14:18
icezimmbut juju status show as agent started...14:19
icezimmjuju debug-log is the same as ssh logging on all machine and concatenate juju/all-machines.log ?14:20
lazypoweryep14:20
icezimmgood to know :)14:20
lazypoweryou can also pass filters to juju debug-log with -i and -x so you can target specific machines14:20
icezimmAdded charm "cs:wily/ubuntu-1" to the environment.14:20
icezimmgreat!14:20
icezimmheheh14:20
icezimmseems juju deploy ubuntu acquired a new machine from my maas ppol14:21
icezimm*pool14:21
jamespagegnuoy`, https://code.launchpad.net/~james-page/charm-helpers/mitaka/+merge/28044914:33
gnuoy`jamespage, +114:35
=== verterok-away is now known as verterok
icezimmlazypower: ubuntu seems it was deployed14:52
lazypowericezimm: no errors in the log? Also, did maas chose the same node? :)14:52
lazypower*same node as you were trying to provision for landscape14:53
icezimmhummm actually no14:53
icezimmsudo openstack-install --openstack-release liberty --edit-placement --headless --debug --series wily -c config.yaml was booting machine 114:53
icezimmbootstrapping juju14:53
icezimmand then deploying services as containers14:53
icezimmnow juju deploy ubuntu got a new bare metal machine and installed on it14:54
icezimmnot as a container14:54
PrabakaranHi kwmonroe, Good Morning... How to have a check for the value getting from the config.yaml file in the decorated pattern. Like i am facing a scenario wherein i will have to get EULA value from the user as True or False. If EULA value which I am getting it from config.yaml file is true i will have to install IBM java SDK else it will uninstall the product. So I have used something like that, it was not working. Can you please suggest15:04
Prabakaranthis?15:04
Prabakaranjavasdk_license_accepted=`config-get accept-ibm-javasdk-license` @when 'java.connected' 'java.installed' '$javasdk_license_accepted== 'False'15:04
Prabakaranjavasdk_license_accepted=`config-get accept-ibm-javasdk-license` @when 'java.connected' 'java.installed' '$javasdk_license_accepted== 'False'15:04
mbruzekHello Prabakaran.  The decorator does not work on configuration options.  cory_fu correct me if I am wrong.15:05
mbruzekPrabakaran: What I have done is create a method that will be called on "config-changed" such as:15:06
mbruzek@hook('config-changed')15:06
mbruzekdef config():15:06
mbruzekPrabakaran: Then you can check the configuration for accept-ibm-javasdk-license and set a state that your charm could react to.15:07
mbruzek    accepted = hook.config().get('accept-ibm-javasdk-license')15:08
mbruzek   15:08
mbruzekNow if accepted is true you can set_state("license.accepted')15:08
mbruzekAnd other methods could use:15:08
mbruzek@when('license.accepted')15:08
mbruzekbut kwmonroe may have more experience with this so I defer to him15:09
mbruzekPrabakaran: Does that make sense?  Do you have any questions?15:09
Prabakaranmbruzek , @when('license.accepted') here how to get this license.accepted value from config.yaml file?15:11
mbruzekPrabakaran: Are you using python or bash?15:11
Prabakaranhere i think we have to change ...accepted = hook.config().get('accept-ibm-javasdk-license')15:12
Prabakaranbash15:12
mbruzekPrabakaran: Oh OK. I gave you an example in bash15:12
mbruzekI mean python15:12
mbruzekOK so you already listed how to get the value from the config.15:13
mbruzekjavasdk_license_accepted=`config-get accept-ibm-javasdk-license`15:13
Prabakarans15:13
mbruzekI don't think you can not use that variable in a @when clause though,  cory_fu would know for sure.15:14
mbruzekPrabakaran: so you would need to create a hook for config-changed, read the value and then you can set a reactive state when the value is true or set a different state when false.15:14
mbruzekPrabakaran: then your methods could react to that state15:15
mbruzekif [ $javasdk_license_accepted == "True" ]; then15:16
mbruzek  set_state 'license.accepted'15:16
mbruzekelse:15:16
mbruzek  set_state 'license.not.accepted'15:16
mbruzekfi15:16
mbruzekSomething like that.  I have not tested that code.15:16
mbruzekafter you set the state then you can use that state in a @when or @when_not clause15:17
Prabakarank let test this15:17
Prabakarank thanks...15:17
mbruzekPrabakaran: but do that confg-get in the "config-changed" hook15:17
Prabakaranlet me test it and come back15:17
mbruzekOK15:17
lazypowermbruzek: no your suggestions are correct. ou cannot use a @when decorator with config, you would  instead check on the hook contest for config-changed, and set/remote a state depending on the value of the config option.15:17
lazypower*context15:17
Prabakaranbefore i have implemented something like that.. but while testing when i set EULA value to true it was installing but again i set EULA value to false it was not uninstalling...http://paste.ubuntu.com/14005951/15:20
Prabakarani think i should not have a check for EULA in this http://paste.ubuntu.com/14005951/15:20
lazypowerPrabakaran: you need to have a decorated method to uninstall when the value is false15:21
lazypowerPrabakaran: @when_not('license.accepted') def uninstall_ibm_jdk(): # uninstall the jdk15:21
Prabakaran<lazypower> is it in python? or bash?15:22
Prabakaranbecause i am writing in bash15:22
lazypowerPrabakaran: the example i just gave was python, but its very similar for bash15:22
marcoceppiaisrael: siege, cassandra-stress, monogdb, pts, mysql-benchmark - am I missing any?15:23
mbruzekPrabakaran: you still need to check configuration parameters in config-changed that is the ONLY hook that is run when configuration changes.15:23
mbruzekkwmonroe: feel free to chime in here with some JDK knowledge15:24
Prabakarank <lazypower> and <mbruzek> .. Thank you so much for this suggessions and explainations..let me implement and test my charm and come back to you if i have any doubts15:26
mbruzekPrabakaran: happy to help15:26
Prabakaranlol15:26
mbruzekPrabakaran: I understand the reactive stuff is new, but it is very powerful15:26
mbruzekPrabakaran: I have written charms much faster and they are much smaller because I only react to the states that this layer needs15:27
mbruzekPrabakaran: I hope you find the same benefit15:27
Prabakarani want to read more about this ..can i have any links for the same?15:28
Prabakarani googled i have got some links but if u feel something good that can be shared to me ..15:29
icezimmlazypower: was supposed to deploy on a container? or should I try to deploy openstack?15:34
PrabakaranI am back again with one question .. using charm build command i have generated deployable charm which contains config changed hook in python.. can u please help me in writing code to have a check for EULA ..http://paste.ubuntu.com/14006238/15:34
lazypowericezimm: i would deploy landscape to a physical unit, and use that to stand up openstack w/ autopilot15:35
lazypowericezimm: but admittedly, i have no experience with our openstack installer you were using15:35
lazypowericezimm: disclaimer - i work in the eco, and i haven't touched every nook and cranny of the openstack suite we have :)15:36
icezimmlazypower: eco you mean? heheh15:37
icezimmno problem, thanks for the help, not I know (at least) juju is being bootstrapped correctly15:37
lazypowericezimm: ah, im a juju charmer, and i work in the broader ecosystem. I've got some experience with openstack - but mostly i look at workload charms. App Container focused charms as it were.15:40
icezimmhummm interesting hehehe15:41
icezimmso a juju question hehehe15:41
icezimmlandscape exists only for trusty15:41
icezimmno way to run on wily?15:41
icezimmI mean, deploy15:41
marcoceppiicezimm: there is a way, but it's not the prettiest15:41
icezimmcool15:42
icezimmbecause I'm asking openstack installer to use series wily15:42
marcoceppiicezimm: you need to download the charm to your machine, and use deploy local:15:42
marcoceppiicezimm: ah, from the openstack installer I don't know/think so15:42
icezimmand I think it's trying to deploy landscape-server to wily15:42
icezimmlet me force series trusty15:45
cory_fumbruzek: Sorry I'm late to the discussion, but I think what you suggested was correct.15:52
cory_fukjackal: So, you were asking about https://github.com/juju-solutions/charms.reactive/blob/master/charms/reactive/relations.py#L498 and why remove_state calls set_state...15:53
cory_fukwmonroe, admcleod1: ^ in case you're interested15:53
cory_fukjackal: So, the answer is that it's because a state can be set for multiple conversations.  You'll notice that there's a "conversations" list in the state value.  That holds all the conversations that the state applies to, not just this one.  So remove_state removes the current conversation from the list, and either updates the state with the new, shorter list, or removes it if it was the only one in the list to start with15:54
cory_fuSo, that really should be "update_state"15:55
cory_fuBut set and update are the same thing in this case.15:55
kjackallet me digest this15:56
gnuoy`jamespage, two new layers as discussed http://paste.ubuntu.com/14006647/15:57
kjackalcory_fu: So in my case the fact the state in not removed is because it was added actually two times, while it gets removed once?16:00
cory_fukjackal: Correct.  Which is what the fix in https://github.com/juju-solutions/charms.reactive/pull/41 is intended to rectify16:00
cory_fukjackal: The "conversations" list was originally a set() object but then I found out that doesn't serialize properly.  :/16:00
kjackalI see, that makes sense, because i see the state value increasing instead of decreasing16:01
kjackalcool16:01
=== JoshStrobl|AFK is now known as JoshStrobl
lazypowercory_fu: i filed a bug against what i pinged about re: charms.reactive all_states here: https://github.com/juju-solutions/charms.reactive/issues/4216:52
jamespagegnuoy`, took a run through those layers - did a few tweaks and tidied a bit17:19
jamespagespecifically17:19
jamespagebase_charm -> charm17:19
jamespagedropped tox and test-requirements from higher layer charms17:19
jamespageadded metadata.yaml to openstack-api layer so inheriting charms don't have todo interfaces for db, messaging and identity.17:19
jamespagepushed all that back to the repos...17:19
beisnerjamespage, mp for review @ https://code.launchpad.net/~1chb1n/charm-helpers/os-amulet-test-mitaka/+merge/28048017:22
cfxmbruzek: ha, looks like I'm not the only one irrationally resistant to layers (but I'm coming around)17:35
bdxmarcoceppi, coreycb: hey whats going on? I am trying to add a wheel to the wheelhouse and have it install alongside the other default wheels in the wheelhouse on bootstrap of the charm.18:32
bdxmarcoceppi, coreycb: Is this an reccomended best practice for installing python packages inside the context of the charm?18:33
bdxmarcoceppi, coreycb: I also see the charmhelpers function from charmhelpers.contrib.python.packages import pip_install18:35
cory_fulazypower: Replied to your ticket.  I can't reproduce.  :(18:36
bdxmarcoceppi, coreycb: I have had no luck using either method.........might you bestow upon me the knowledge needed to make this happen?18:36
marcoceppibdx: what version of charm-tools do you have? `charm version` ?18:37
bdxcharm-tools 1.10.118:37
bdxmarcoceppi:^18:39
marcoceppibdx: how are you adding the wheel?18:39
bdxmarcoceppi: git clone https://github.com/locustio/locust.git, cd locust, python setup.py sdist18:40
marcoceppibdx: okay, normally wheelhouses are included by defining them in a wheelhouse.txt file18:40
bdxmarcoceppi: cp dist/locustio-0.7.3.tar.gz charmdir/wheelhouse/18:41
bdxok18:41
marcoceppicory_fu: would have better guidance, not sure if that works, but I suppose it should18:41
bdxmarcoceppi: Is there yet a standardized "best" way to install python packages from pip?18:43
bdxcory_fu, coreycb:^18:44
cory_fubdx, marcoceppi: Yeah, I would recommend adding the requirement line to wheelhouse.txt (you can point it at a git URL just fine) and let the build process manage it for you.  You *could* manually put the file into the wheelhouse but you'd want to make sure it was not platform specific.  We don't actually use wheels because of this, and instead just include source .tar.gz files18:44
marcoceppibdx: define them in the wheelhouse.txt https://github.com/juju-solutions/reactive-base-layer/blob/master/wheelhouse.txt18:44
cory_fuAnd to use a git URL, the format is: -e git+https://github.com/locustio/locust.git#egg=locust18:45
cory_fu(The -e, git+, and #egg=<foo> are all important)18:45
cory_fuYou can also include @branch or @sha right before the #egg to use a specific branch or commit18:46
bdxcory_fu: awesome....it seems some pip packages (locust) have a requirement on python-dev ..... how would this be handled, if at all using wheelhouse?18:46
bdxpython packages*18:47
bdxerrrrr^, how are system level level deps handled* ?18:48
cory_fubdx: Currently, it installs pip with all the recommended packages, so it pulls in python3-dev as well.  There was some discussion about making that a layer option so that charms that don't use Python libs with compiled bits could install faster18:48
lazypowercory_fu: ugh :\18:48
cory_fubdx: What other system-level deps do you mean?18:49
bdxlazypower, cory_fu, marcoceppi: locust for example only supports python2.718:49
bdxand requires python-dev as a system level deb18:50
bdxdep18:50
cory_fulazypower: TBH, I don't see how that could possibly happen.  all_states doesn't modify anything at all, it just calls get_states and makes an assertion about the result.  :/18:50
marcoceppibdx: is locust required for your hooks to run?18:50
marcoceppior is it part of the software you're installing?18:50
bdxmarcoceppi: it is the primary software pkg I am *trying* to get installed18:51
cory_fuYeah, what marcoceppi is getting at is that the wheelhouse is only intended for *charm* deps.  i.e., libraries that are required for your charm code to run, not the the thing it's deploying18:51
cory_fubdx: You shouldn't use the wheelhouse for that, then.18:51
lazypower^18:51
marcoceppibdx: in your install decorator, just do subprocess.check_call(['pip', 'install', 'whatever']) Or, git clone/installing18:51
bdxlazypower, cory_fu, marcoceppi: ok, thats what I was thinking....but it needs python218:52
bdx*python2.7*18:52
cory_fubdx: I'd recommend using charmhelpers.fetch.apt_install18:52
marcoceppibdx: yes, pip is python2, pip3 is python3, you can use the charmhelpers.fetch.apt_install to install python-dev18:52
lazypowermarcoceppi: does that change w/ xenial?18:53
bdxcory_fu, marcoceppi: got it, but then I can't install the python2 pkg18:53
bdxno matter what18:53
lazypoweras in, will pip be python3 pip, or is it still py2 pip (which... is no longer a thing i hear?)18:53
marcoceppilazypower: no idea18:53
bdxeven if I ssh into the box and install from the box18:53
cory_fuapt_install(['python-dev', 'python-pip'])18:53
cory_fusubprocess.check_call(['pip2', 'install', 'locustio'])18:53
marcoceppilazypower: python2 is still athing18:53
lazypowerok i'll mak eit a point to find out18:53
marcoceppilazypower: it's just not installed by default18:53
marcoceppithere's a difference :)18:54
lazypoweri was inferring from stubs comments about py2 deprecation on a system level that we're headed for heartache in xenial18:54
cory_fulazypower, marcoceppi: You can always be explicit and use pip218:54
lazypoweri may have mis-read into it18:54
marcoceppiyesh18:54
cory_fubdx: What do you mean you can't install the python2 package?18:55
bdxusing from charmhelpers.contrib.python.packages import pip_install18:55
bdxor just in the terminal18:55
bdxwhen ssh'd into the box18:55
bdxcory_fu: although, I was running "pip install", not "pip2 install" ..... should "pip2" be the answer then?18:56
cory_fubdx: I don't understand why you think that wouldn't work?18:56
cory_fubdx: I'm pretty sure that even with python3 installed, "pip" is still the same as "pip2"18:56
bdxcory_fu: let me recreate, and grab you some hard data on this.18:56
cory_fuBut being explicit isn't a bad thing, either18:57
bdxcory_fu, marcoceppi, lazypower: so whats up with "from charmhelpers.contrib.python.packages import pip_install" this only works for python3/pip3 pkgs?19:06
marcoceppibdx: hooks run as python3, so probably19:06
bdxmarcoceppi: how to you feel about modifying the pip_install function to take an optional bool arg for pip2?19:08
marcoceppibdx: sounds fine19:08
bdxmarcoceppi, cory_fu, lazypower: It doesn't look like pip2 is a thing .....19:09
cory_fubdx: Your reality does not seem to be the same as mine: http://pastebin.ubuntu.com/14011024/  :)19:10
bdxcrazy19:10
cory_fuAlso, it looks like pip_install only uses subprocess if it's creating a venv, for some reason.  It should just always use subprocess: https://bazaar.launchpad.net/~charm-helpers/charm-helpers/devel/view/head:/charmhelpers/contrib/python/packages.py#L6719:11
bdxcory_fu: my bad...didn't have python-pip as a dep19:11
cory_fubdx: That'll do it.  :)19:11
bdxmarcoceppi, cory_fu, lazypower: I think I'm g2g now. Thank you all!!19:12
cory_fubdx: Glad to help!19:12
bdxcory_fu, marcoceppi, lazypower: Is charmbenchmark the best way to get stdout from an action?20:19
bdxcory_fu, marcoceppi, lazypower: Also, if charmbenchmark is used, should it then be added to the wheelhouse?20:20
marcoceppibdx: charmbenchmark is a depricated library20:20
marcoceppibdx: charms.benchmark is the new library20:20
marcoceppibdx: but it doesn't get stdout from an action, it uses action-get and action-set to send and recieve action data20:20
marcoceppibdx: it's meant as an easy wrapper for benchmark actions20:21
marcoceppibdx: charmhelpers.core.hookenv has an action_get, action_set, and action_fail method20:21
bdxmarcoceppi: gotcha, I see that.... I'm trying to return a few values to the user after the action is ran, what is the way in which I should go about this?20:22
marcoceppibdx: action_set('key', value)20:22
bdxmarcoceppi: but action_set and action_get must be called from the action.....right?20:24
marcoceppibdx: yes20:24
bdxmarcoceppi: How can I return values to the user executing the action?20:25
marcoceppiaction_set20:25
marcoceppibdx: action_get is used to recieve the parameters a use has set for the action, action_set returns data to the user from that action20:26
marcoceppiboth can only be run from an action20:26
bdxmarcoceppi: e.g.  I want my users to run "juju action do locust/0 run-tests --params params.yaml"20:26
bdxmarcoceppi: following that command, I want to return a ip:port to the user20:27
marcoceppiokay, you have to use action_set to send the data, eg: action_set('address', ip:port)20:27
bdxmarcoceppi: I get that....where does that send the data?20:28
marcoceppibdx: the user has to run juju action fetch <UUID>, the UUID will be presented when they do juju action do20:28
bdxmarcoceppi: ok, awesome, thats what I was looking for! Thank you20:29
marcoceppibdx: sure, np!20:29
Iceyhow can I handle sharing functionality between reactive handlers and action handlers without resorting to weird hacky things like messing with the load path?21:12
lazypowerIcey: path :cop: approves of this question ^21:12
marcoceppicory_fu: ^?21:13
cory_fuIcey: There is an open issue (https://github.com/juju-solutions/charms.reactive/issues/11) related to this.  Currently, there is no built-in support for actions in charm-build nor in reactive.21:13
cory_fuI think that we should do it, but charm authors will need to be aware that *all* handlers whose conditions match will be run.  So if you don't guard properly, you could have actions doing things like restarting your service because you assume "hook run means something changed"21:14
lazypowercory_fu; wait so build doesn't merge actions.yaml?21:14
lazypowergood to know. i had not considered that when building out my layers21:14
cory_fulazypower: No, it doesn't.  :(21:14
cory_fuAt least, I'm pretty certain it doesn't21:15
IceyI generally think that the actions should NOT share functionality with Hooks, but that Hooks and Actions should both call helper functions to handle their shared functionality ;-)21:15
lazypowerthat'll change at some point i'm willing to bet21:15
marcoceppilazypower: that's more a charm-tools issue, but it's imporant21:15
lazypowermarcoceppi: oh i agree, and i said 'build' :)21:15
* marcoceppi misread21:15
cory_fulazypower: We need an ActionYAML that is a trivial subclass of YAMLTactic in: https://github.com/juju/charm-tools/blob/master/charmtools/build/tactics.py#L62221:16
marcoceppilazypower cory_fu: https://github.com/juju/charm-tools/issues/8221:16
cory_fuBut if we want to have proper reactive support, it will also need to build the hooks out21:16
lazypowercory_fu: is that a prompt for me to get un lazy and go contribute?21:16
lazypoweri can see merging the actions yaml and including w/e is in actions/*21:16
lazypoweri'm undecided on if actions in reactive is a good thing21:17
lazypoweri'm already generating a script that matches the definition in actions.yaml, i dont know that generating them with decorators really saves me anything other than creating the file21:17
lazypowerit actually limits me in what my action is written in if i'm mixing bash and python actions21:17
Iceylazypower I'd like actions to be a lot like old school hooks21:18
Iceyyou can have bash scripts21:18
lazypoweror maybe not even a script at all, maybe i stuff in a binary that ships w/ whatever service and convert the flags to options that it passes to the binary21:18
Iceyyou can have an actions.py with links21:18
lazypoweror maybe i'm just pulling stuff out of the air now21:18
marcoceppiI think actions in reactive is the right way forward, tbh21:18
marcoceppibut I am in the minority21:18
lazypowermarcoceppi: to you, whats the benefit of actions in reactive?21:19
marcoceppilazypower: I think for now, just having it merge the yaml is enough21:19
lazypoweri'm asking more for my education21:19
lazypoweras i've noodled this topic for about, 40 seconds.21:19
lazypowerclearly i'm an authority21:19
marcoceppilazypower: one place to manage my code, the model is all reactive, and I can more easily assert and manage states in actions21:20
lazypowerhmm21:20
lazypowerthats fair21:20
marcoceppilazypower: however21:20
lazypower@when('backup.is_complete')21:20
marcoceppiI think there's a middle ground21:20
lazypoweractually21:20
lazypowerwhats stopping you from doing that today?21:20
lazypoweryou can call charms.reactive set_state backup.is_complete and still handle it on your next update-status run21:20
marcoceppilazypower: actions are not hooks21:20
marcoceppioh, sure, but I also have to mung paths21:21
marcoceppithe source tree isn't as clean21:21
lazypowerpath :cop: disapproves of path munging21:21
marcoceppilazypower: I think the way forward is, if actions/<action_name> exists, leave be, otherwise auto-generate stub and assume it's reactive21:22
Icey+1 to that marcoceppi21:22
marcoceppilazypower Icey however, the second half of that is a bit more complicated to produce, since it requires changes to the reactive framework21:23
lazypowerthat makes sense21:23
cory_fumarcoceppi: Eh, not much.  Mostly just adding an @action decorator.  I don't think it needs anything else?21:24
marcoceppicory_fu: okay, maybe it's not hard21:24
lazypowerand yeah i'm 100% for getting the yaml merge first, hten tackling the reactive bits in tandem wl/ the generator(s)21:24
* marcoceppi was just guessing21:24
cory_fuAnd you could probably use @hook in the meantime21:24
Iceycan I access config inside of an action?21:24
marcoceppiIcey: you should be able to21:24
lazypowerits an anonymous hook context, so sure21:24
Icey:)21:24
marcoceppicory_fu: depends on how "hook name" is determined21:24
cory_fumarcoceppi: It uses $021:25
marcoceppioh, cool21:25
cory_fuTechnically, it looks for $JUJU_HOOK_NAME and falls back to $0, but JUJU_HOOK_NAME is only set in debug-hooks21:25
cory_fuAnd presumably wouldn't be set for an action even during debug-hooks21:25
marcoceppinope21:26
cory_fuSo @hook should really Just Work, but we need to have an alias so that it's clear that it's intended for actions21:26
* marcoceppi acks21:26
marcoceppiMaybe I'll take a stab at that over the holidays21:26
cory_fumarcoceppi: If you merge https://github.com/juju/charm-tools/pull/75 it should be pretty trivial21:27
marcoceppicory_fu: merged, this also has conflicts now https://github.com/juju/charm-tools/pull/6821:29
cory_fumarcoceppi: Well, I guess it'd need a little refactoring; the DynamicHookBind class would need a prefix option that could be overridden to switch "hooks" for "actions"21:29
marcoceppicory_fu: I'll be looking to release 1.11.0 this week21:29
cory_fuNice21:29
lazypowermarcoceppi: movin right along man! we've got a nice rel cadence going with c-tools21:29
lazypowerhattip @ you and the contributors21:30
marcoceppilazypower: the day releases slow down, is the day cory_fu stops making charm build better ;)21:30
lazypowercory_fu: i will bribe you with as much pizza as you can carry21:31
lazypowercory_fu: and scotch21:31
cory_fumarcoceppi: Resolved21:31
cory_fumarcoceppi: So yeah, if you want to take a stab at adding generated actions now, just look at how it's done now for StorageBind.  You'll need a new subclass of DynamicHookBind and a similar method in build/__init__.py:Builder.plan_{interfaces,storage,actions} (maybe those could be refactored)21:35
marcoceppicool21:35
cory_fuAs I said before, DynamicHookBind will need to override the dir prefix, and the HOOKS list for ActionsBind would just be ['{}']21:36
cory_fu(i.e., use the action name as the file name, no suffix)21:36
=== blahdeblah_ is now known as blahdeblah
cholcombei have a juju action parameter that needs to be any type.  Can i just use type: object for that?22:34
marcoceppicholcombe: why not string?23:28

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