/srv/irclogs.ubuntu.com/2018/04/18/#cloud-init.txt

rharpersmoser: shall I land https://code.launchpad.net/~raharper/cloud-init/+git/cloud-init/+merge/343122  ?00:12
blackboxswI'm for  it as mentioned, I think we can do a followup with something dynamic if needed.00:51
blackboxswI'd like us to continue spending time on the CLI, so there will be ample opportunity if needed to touch this again and make it dynamic at that point.00:51
blackboxswas it is for now it's fast and correct and 'done' so I'm all for that00:51
smoserrharper: yeah.00:52
blackboxswwe can borrow  some simple regex cli --help parsing that landscape-api CLI did for the next iteration, it won't be too bad to pull in.00:53
smoseri consider myself more competant than one should be with shell scripting00:53
smoserand compgen stuff just makes me cringe00:53
blackboxswseen here is another option. but yeah uses compgen too https://bazaar.launchpad.net/~landscape/landscape/trunk/view/head:/canonical/landscape/api/client/etc/bash_completion.d/landscape-api00:55
blackboxswand yeah, I'm all for something simple if we could get away with it00:55
blackboxswsmoser: sorry I'm late on the review comments of ifconfig->iproute2 stuff, still massaging unit tests for the switch to look before you leap (i.e. which('ip') elif which('ifconfig') )00:57
blackboxswFTR, I agree with the approach to testing for the cmd before running it. instead of all the CalledProcessError handling00:58
smoserblackboxsw: yeah, i knew that that was going to be a pain for your tests00:58
smoserone way or another we shoudl decide "we are using 'ip'" and then use it00:58
blackboxswyeah right, instead of separate tests in each separate function (ip vs netstat    or  ip vs ifconfig)01:00
blackboxswyeah just a has_iproute2 would be easy, only one thing to mock then.01:00
blackboxswI might just make that change now, as it's too late to get this fixed and back to you for review tonight anyway01:01
blackboxswmeh, n/m I retract that statement, as we also check which(netstat) and which(ifconfig) and have different error messages/failure paths to handle, so the consolidation doesn't buy much as we'd have to still handle ProcessExecutionErrors and log warnings if the 2nd command we run isn't present anyway01:04
blackboxswahh well01:04
smoserfreebsd uses ifconfig i believe ?01:05
smoserother than that i would be fine to assume that if you have netstat then you have ifconfig01:05
smoserthey';re' both from net-tools01:05
rharpersmoser: ok, pushing bash completion01:06
rharperblackboxsw: Yeah, regex parsing is one way though I think the parsers are relegated to other files, so we can't just grep through cmd/main.py;  the recursive --help invokation may be more robust and we can do that at build-time so we have a static bash file.01:10
blackboxsw+1 rharper we can create a ./tool to gen that static file from recursive --help invocations01:31
blackboxswgood pt01:31
blackboxswcould do it at build time. or just run it on a branch in progress prior to commit01:32
=== pmcnabb_ is now known as pmcnabb
smoserblackboxsw: have a minute ?16:13
blackboxswyes definitely16:22
blackboxswsmoser: heading to hangout16:22
blackboxswrharper: smoser dropped Metric column from route info output to retain original behavior. Only differences in behavior to what currently exists in bionic when relying on ip instead of ifconfig/netstat are that we do the following:17:11
blackboxsw1. properly print full scope name for addrs as presented by ip17:11
blackboxsw2. drop trailing ':' in the device column17:11
blackboxsw3. print ipv6 addrs instead of '.'17:12
blackboxsw4. print an ipv6 routes table17:12
blackboxswsmoser: rharper the diff on an ec2 instance: https://pastebin.ubuntu.com/p/KZWYPbCRvC/17:12
smoserare we consistent with o urselves now ?17:14
smoserbetween ifconfig and ip17:14
smoserblackboxsw: my freebsd seems not working on server stack :-(17:18
* blackboxsw is trying freebsd on ec217:18
rharperblackboxsw: can you run ec2 with ipv6 addr so we can see the diff?  I didn;t think we displayed link-local ip6 addrs; and we don't split out v4 and v6 for netdev, but we do for route ?17:41
blackboxswrharper spinning one up now17:43
rharperblackboxsw: w.r.t the interface to the various parse output methods;  as smoser has told me, if you don't want someone using the modules as an api, then you need to use _ prefix17:43
rharperotherwise, those methods in netinfo *are* an api, and that means callers could pass non-strings to you17:44
blackboxsw+1, I should change that17:44
rharperif smoser doesn't mind, then I'm OK with not adding checks on the inputs, but it seems reasonable to me to set those as input=None, and then add if not input: input = ""17:44
rharperor something safer;17:45
smoserwhy set a default ?17:48
smoserthey require input17:48
rharperone way of ensuring you don't blow up doing .split() on a non string for typical usage, None is more comment than passing in a dict;  or raise valueerror on the wrong type17:52
smoserrharper: well, we really aren't providing an api. we're just not really doing that.17:52
rharpersmoser: then it I think blackboxsw will end up marking the methods with _17:52
smoserwe should, and ideally would. but just really are not.17:52
smoserrharper: there is no reason to provide a default variable17:54
smoserchanging17:54
smoser def netdev_info_iproute(ipaddr_out):17:54
smoserto17:54
smoser def netdev_info_iproute(ipaddr_out=None)17:54
smoseris contrary to useful17:54
rharpersure17:54
smoserraising a TypeError if ipaddr_out is not a string is fine.17:54
blackboxswyeah +1 not defaulting as we don't want users calling netdev_info_iproute(). it needs something to parse17:55
blackboxswTypeError I balked at because our code is the only caller and it stuffs in util.subp output which is a known quantity of a string type17:55
smoserright.17:56
smoserso that is why i didnt' feel we need it.17:56
blackboxswso it's a case where I didn't feel users could likely induce a failure path by presenting an invalid type17:56
smoserat this point we're not *really* providing an api.  no one that is using cloud-init as a python library (at thsi point) is surprised by that :)17:57
smoserthat isnt that we shouldnt. just that we're imature.17:57
blackboxswif we were, say, processing user-provided cloud-config information which we've loaded into a dict, then I'd be more concerned about checking types of data etc.17:57
smoseryeah, i largely agree with that.17:57
smoserbut i'm also OK to just shove a _ on it too.17:57
blackboxswyeah I'll do that _ as I feel like for our own sanity it's nice to designate what we think should really have internal (to the module) callers17:58
blackboxswit's a good function/method documentation policy17:58
mgerdtssmoser: thanks for landing those18:07
blackboxswrharper: ec2 w/ ipv6 address18:20
blackboxswhttps://pastebin.ubuntu.com/p/96qtpRpdxV/18:20
rharperthx18:21
rharperso, the link-local is new, as is the lo in the routing v6 table18:21
rharpershould we clean those up?  unreachable seems unhelpful, on the fence on link-local ipv6 values, we're not showing link-local v4 stuff18:22
smoserlink local is new ?18:22
rharperprinting link-local values in the net dev info table18:22
rharperyeah, look at the 17.2 vs 18.218:22
blackboxswyeah it was previously just .18:23
blackboxswjust absent I mean18:23
smoserblackboxsw: so what are you doing with all that ?18:43
smoserare we looking to make output identical to previous ?18:43
blackboxswsmoser: rharper I just wanted to see if you guys had concerns about that behavior and if you think we should avoid printing link local info like line 29 of https://pastebin.ubuntu.com/p/96qtpRpdxV/18:45
blackboxswand if line 27 and 30 should really be like 8 and 1018:46
blackboxswdo we want to continue to not process/report certain data, even though I fixed what I felt was a bug in the ommission18:46
rharperI dunno; my use of that table is mostly restricted to seeing what networking as applied, typically the ipv4/v6 addresses, I don't think for clouds many users will ahve a second instance in the same network where they could reach it via link local18:46
smoseri dont think line 29 is bad.18:47
blackboxswalso the whole table line 40+ (ipv6 routes) is 'new'18:48
smoserand i'm fine with 27 and 30 too18:48
smoseri think they're generally improvements.18:49
smoserblackboxsw: for the ipv6 output18:50
smoseri think there is no reasno to show routes on interface lo18:50
smoser(they're not seen on ipv4)18:50
blackboxsw+1 will drop them18:52
blackboxswfor SRU fodder, would we want to drop the ipv6 route table altogether18:52
blackboxsw?18:52
blackboxswor it's just more output that users could take advantage of (not really change in existing functionality presented by other tables)18:53
smoseri think its fine. idont really believe any tools are likely scraping that.18:53
blackboxswcool sound good rharper ?18:53
rharperblackboxsw: yeah, I agree with smoser18:56
smoserblackboxsw: can i help you with anything ?19:11
blackboxswall good. just pushed all changes19:13
blackboxswwas going to make deb one more time and test lxc and ec2 while waiting for ci19:14
blackboxswsmoser: rharper all done19:14
rharpernice19:14
blackboxswwill pastebin one more pass19:14
smoserrharper: i have updates to https://code.launchpad.net/~smoser/cloud-init/+git/cloud-init/+merge/343246 and responses to your comments19:14
blackboxswdone smoser rharper https://pastebin.ubuntu.com/p/dK8JBmdpNk/19:18
blackboxswlooks good19:18
blackboxswI think we can land it and I'll put up a merge proposal for bionic if that sounds good?19:19
blackboxswhttps://jenkins.ubuntu.com/server/job/cloud-init-ci/1025/ in progress19:21
* blackboxsw will be back in 30 mins19:33
smoserhttps://www.diffchecker.com/9sLtnCgT19:41
smoserblackboxsw: i put a patch on there. https://code.launchpad.net/~chad.smith/cloud-init/+git/cloud-init/+merge/34242820:04
blackboxswwaiting on ci20:35
smoserblackboxsw: marked approved20:56
blackboxswsmoser: sorry power loss. I'm back up, landing and publishing21:21
blackboxswand cutting a bionic upload MP21:22
blackboxswsmoser: it'21:29
blackboxsws up https://code.launchpad.net/~chad.smith/cloud-init/+git/cloud-init/+merge/34356221:29

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