/srv/irclogs.ubuntu.com/2017/09/08/#cloud-init.txt

smoserblackboxsw, we will. none of those are terribly important. the ppc64 breakage isn't present in the SRU'd version.01:41
smoseri dont think01:41
=== shardy_afk is now known as shardy
=== shardy is now known as shardy_mtg
=== shardy_mtg is now known as shardy
=== shardy is now known as shardy_mtg
=== shardy_mtg is now known as shardy
smoserblackboxsw, i should have noticed / thought of this before, but by doing the json schema doc16:42
smoserwe lose16:42
smoser python316:42
smoser >> from cloudinit.config import cc_bootcmd16:43
smoser >> help(bootcmd)16:43
smoserer... help(cc_bootcmd)16:43
smoserright ?16:43
blackboxswhrm right smoser17:00
blackboxswsorry was in another window17:00
blackboxswgood thought, I bet we can fix that17:01
blackboxswyeah I can fix that.  smoser WDYT? http://paste.ubuntu.com/25491373/17:04
smoserblackboxsw, http://paste.ubuntu.com/25491366/17:04
smoserthat was mine17:04
blackboxswhaha17:04
smoseryours prettier17:05
blackboxswyeah we already have get_schema_doc. no need for a 2nd function :)17:05
blackboxswI can fold that into the cc_bootcmd/resizefs branch (and fix runcmd/ntp as well)17:06
smoserget_schema_doc modifies schema17:06
blackboxswahh true, could deepcopy17:07
smoserthe other issue with your solutin there is it is slow. i think17:07
smoseri think we then hit usage of yaml on import of cc_bootcmd17:07
smoserso i dont know.17:08
blackboxswlemme see how yours outputs17:08
smosernot anywhere near as nice.17:08
smoserand i'd have used yorus if i had know of that17:09
blackboxswright, but at least it's something (because I'd like to trim the module docstr to a single line of text in all modules w/ jsonschema)17:09
* blackboxsw really wonders how much 'support' we need to worry about for help() callers in python shell17:10
blackboxswI'd be inclined to use your markup to meet the need if it arises (but avoid the cost of templating etc on module load)17:10
smoserblackboxsw,17:15
smoser        yaml_string = yaml.dump(property_dict.get('enum')).strip()17:15
smoser        property_type = yaml_string[1:-1].replace(', ', '/')17:15
smoseris there a reason not :17:15
smoser property_type = '/'.join(property_dict['enum']) ?17:15
blackboxswsmoser: for docs I wanted the actual strings rendered to match what we expect users to write in a yaml file17:17
blackboxsw'true/false' instead of True/False17:17
smoserah. that does make sense.17:17
blackboxswbut doesn't yaml accept both?17:18
blackboxswRegexp:17:18
blackboxsw y|Y|yes|Yes|YES|n|N|no|No|NO17:18
blackboxsw|true|True|TRUE|false|False|FALSE17:18
blackboxsw|on|On|ON|off|Off|OFF17:18
blackboxswmeh, so maybe it doesn't matter http://yaml.org/type/bool.html17:18
blackboxswheh not fully supported17:22
blackboxswhttp://pastebin.ubuntu.com/25491483/17:22
blackboxswsome of the regexps don't seem to match. better to be safe/strict17:22
smoser http://paste.ubuntu.com/25491485/17:23
blackboxsw+1 simple and efficient17:24
blackboxswI'll add that smoser17:24
blackboxswbetter not to spec cycles on yaml.load if all we want is a simple dict lookuo17:24
blackboxswbetter not to spec cycles on yaml.load if all we want is a simple dict lookup17:24
smoserblackboxsw, name 'ymap' as "_YAML_AS_STRING" or something and put it at top of that17:25
blackboxswyeah w/ a oneline comment explaining the intent17:26
blackboxswwill do17:26
smoserthen, we're fairly close to not even importing yaml17:27
smoserexcept on checking17:27
blackboxswcould separate that to a different module17:28
blackboxswhrm, also in some of the other doc generation we have yaml.dump calls17:30
blackboxswlike rendering schema['examples']17:30
smoseri think that was the only other one17:36
smoserright?17:36
smoserblackboxsw, ^17:52
smoseri'm not sure why wer'e using yaml to dump the examples, which are already formatted strings17:52
smoseroh. i see.18:14
blackboxswsorry was running an errand.18:20
blackboxswsmoser: yeah I had allowed for either md formatted strings or python dict objects18:21
blackboxswprobably something that we don't really have to support and we could drop the yaml.dumps stuff18:21
blackboxswI had thought we might want to leverage examples automated  unittests, and having a examples in dict format already provided  would make it easy to pass into some automated handle tests.18:22
blackboxswbut, we could just as easily have the unit tests yaml.load(example_content_string)18:23
blackboxswif we every go down that route in unittests18:23
blackboxsws/every/ever/18:23
smoserhttp://paste.ubuntu.com/25491809/18:23
blackboxswI'm glad you agree :) and did the work18:23
blackboxswthanks18:24
smoserhardest part was making flake8 happy18:24
blackboxswI like it18:25
smoserand then we're not far from having yaml only necessary at all in the schema path when validating a cloud-config18:26
smoserspecifically *not* when validating a dictonary18:26
smoser(i realize we have yaml everywhere, so not a big deal)18:27
blackboxswI'm not even sure we need the         else:18:27
blackboxsw            example_content = '\n'.join([e + "\n" for e in example])18:27
blackboxswas all examples will now be an instance of string18:28
blackboxswstill good to avoid dependency if we don't really need it18:28
smoseryeah18:29
powersjblackboxsw: rharper thanks for comments, uploaded new version19:07
smoserpowersj, of kvm ?19:09
powersjsmoser: yes19:10
powersjsmoser: thanks for the explanation re: arrays19:34
blackboxswsmoser: pushed your changes into https://code.launchpad.net/~chad.smith/cloud-init/+git/cloud-init/+merge/330243 + added the __doc__ fixes and an Examples SPACER for documentation where modules have > 1 example20:04
blackboxswonto powersj branch20:05
blackboxswpowersj: have you pushed this to latest? https://code.launchpad.net/~powersj/cloud-init/+git/cloud-init/+merge/32764620:08
blackboxswyou mentioned uploaded new version, but I don't see new commites20:08
blackboxswyou mentioned uploaded new version, but I don't see new commits20:08
* blackboxsw tries a git fetch20:08
smoserblackboxsw, he ammended / --force i think20:08
smoseri think20:08
powersjyeah trying to keep it down to a single commit20:09
blackboxsw+120:09
blackboxswthx20:09
powersjsorry.... if you wanted to see the diff20:09
blackboxswnah, just "broken" process for me when looking at a review I've commented on is seeing whether commits have come in afterward20:10
blackboxswI need to figure out a better process for finding updates on branches20:10
blackboxswhow do you guys normally determine whether a branch you've reviewed has been updated? Just git fetch on the cmdline and watch whether a branch you care about updates?20:11
blackboxswalso, as you mentioned powersj,  having actual commits of the diffs related to review comments speeds up the re-review because I can see what changed and if some comment was missed or interpreted a different way without hunting for the places where comments were made.20:13
powersjyeah...20:13
blackboxswbut, review 'speed' is not an issue when we leave a branch of yours floating in the breeze for weeks ;)20:13
blackboxswhttps://www.youtube.com/watch?v=bcYppAs6ZdI20:14
powersjlol20:16
blackboxswpowersj: approved https://code.launchpad.net/~powersj/cloud-init/+git/cloud-init/+merge/327646 thanks man20:23
powersjblackboxsw: thx, if you do find a run that dies or has issues, please let me know :)20:23
blackboxswpowersj: will run it again right now20:24
blackboxswwhat cmdline did you want?20:24
blackboxswthe test run I called or the ssh connect from paramiko that is failing20:24
blackboxsw3 successes in a row on your latest branch20:32
smoserpowersj, i'm ok with allowing image.execute to take a string or an array20:32
smoserand splitting it if it is a string20:33
powersjsmoser: ok do you want me to go back and revert places where I changed arrays to strings?20:41
powersjblackboxsw: thanks for the re-test20:41
smoserpowersj, just commented there.20:54
smoserwont your changes *break* lxd ?20:54
smoserah. you changed that one to take a string20:54
powersjright and then res = self.pylxd_container.execute(['/bin/bash', '-c'] + [command]20:55
powersjtested both backends ;) don't want any regressions20:56
smoserhttp://paste.ubuntu.com/25492439/21:05
smoseri'll propose that for merge really quick21:05
smoserpowersj, https://code.launchpad.net/~smoser/cloud-init/+git/cloud-init/+merge/33045921:09
powersjsmoser: +1'ed21:11
powersjthank for that21:11
powersjthank you for that rather21:11
blackboxswrharper: adapted util.json_loads to handle unserializable content, just pushed 95c1151..c00091721:29
blackboxswthanks for the review, https://code.launchpad.net/~chad.smith/cloud-init/+git/cloud-init/+merge/330115 is done21:29
rharperblackboxsw: nice!21:30
rharper and no instance-data.json is written.  ?21:30
rharperstill true?21:30
rharperin descr of commit21:30
rharperon MP21:30
blackboxswahh not true21:31
rharperIIUC, we won't throw TypeErrors anymore?21:34
blackboxswlrharper: so, I'm pretty certain that no TypeErrors should be raised now during json_loads. But, I did leave the except TypeError: in get_data() just in case there is something I wasn't aware of. I didn't want some datasources to start raising TypeError exceptions on the json_loads call21:34
blackboxswbut generally the json.loads(default=our_default_handling_functor)  should catch everything unknown to json21:35
rharperok21:35
blackboxswI'mchanging the commit msg for this to represent that21:35
rharperhrm, I'm still confused21:35
rharperwe're parsing metadata ; then we want to dump the metadata which may have unserializble objects21:36
rharperwe don't have an json to load before we dump; so we still have a path where the metadata might have something we cant serialize21:36
rharperno?21:36
rharperwhat would be needed is for json_dumps() to replace the unserializable ojbect with some replacement string indicating error or something like that ?21:37
rharperthat may not be possible; however, we could pre-filter the metadata dictionary for content types that aren't json encodable (which is similar to the load IIUC)21:37
blackboxswcorrect rharper, I added json_serialize_default() which returns the string 'Warning: redacted unserializable type {0}'  for any unserializable keys/values21:39
rharperblackboxsw: I think you confused me with the json_loads;  in dumps you set default=json_serialize_default, which looks like what I was suggested (replaces with string)21:39
rharpernice21:39
blackboxswahh sorry loads... my bad21:39
rharpersorry for the confusion21:39
blackboxswI meant dumps.  Sorry for using the wrong words ;)21:39
rharperexcellent; that's really cool21:39
blackboxswso again , I *think* that should handle all cases of unserializable content, but I left the try/except ValueError & log.warning message in place just in case we run into some other unforseen issue21:40
blackboxswexcept TypeError rather21:41
rharperyep21:46
smoserpowersj, i responded in that kvm merge21:50
smoseri have to run now... we can just order thes a bit different, and som elittle things i mentioned in line.21:50
powersjsmoser: ok thanks21:52
powersjreally appreciate it21:52
blackboxswpowersj: do you recall where #cloud-init irc logs are archived? I thought there was an IRC archive url somewhere which had historical #cloud-init logs22:01
blackboxswI wanted to reference them in the meetingology meeting minutes from last meeting22:01
powersjblackboxsw: https://irclogs.ubuntu.com/2017/09/22:02
blackboxswthat'd be it22:02
blackboxswthanks22:02

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