spent an hour writing a small script, most of that time was trying to find a way to avoid an if statement I was convinced was totally unnecessary. I couldn't and although the script works perfectly I feel it's a bit of a failure.

@stardot Why not share the script! Would be nice to take a look at it


@xvilo Sure, it's just a bit of disposable code to generate some firewall config from a csv. My issue is line 9, I was appending to a dict value but the first time the value returns None so I ended up testing for that, it just seems messy to me. gist.github.com/dnel/583bb49cc

@xvilo I can get a little obcessed with optimisation, it would save nanoseconds but reducing my code by 3 lines, totally worth it 😄

Sign in to participate in the conversation

General purpose mastodon instance