Re: [Cloud-init-dev] [Merge] ~smoser/cloud-init:fix/1771382-ds-identify-ensure-sane-path into cloud-init:master
Review: Approve continuous-integration PASSED: Continuous integration, rev:67270f244f3a96f9328aa983cd957fa55b3f1240 https://jenkins.ubuntu.com/server/job/cloud-init-ci/1/ Executed test runs: SUCCESS: Checkout SUCCESS: Unit & Style Tests SUCCESS: Ubuntu LTS: Build SUCCESS: Ubuntu LTS: Integration SUCCESS: MAAS Compatability Testing IN_PROGRESS: Declarative: Post Actions Click here to trigger a rebuild: https://jenkins.ubuntu.com/server/job/cloud-init-ci/1/rebuild -- https://code.launchpad.net/~smoser/cloud-init/+git/cloud-init/+merge/345786 Your team cloud-init commiters is requested to review the proposed merge of ~smoser/cloud-init:fix/1771382-ds-identify-ensure-sane-path into cloud-init:master. ___ Mailing list: https://launchpad.net/~cloud-init-dev Post to : cloud-init-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~cloud-init-dev More help : https://help.launchpad.net/ListHelp
Re: [Cloud-init-dev] [Merge] ~smoser/cloud-init:fix/1771382-ds-identify-ensure-sane-path into cloud-init:master
Just to write this down somewhere... the adding paths and searching (as compared to just appending PATH=$PATH:/usr/bin:) doesnt cost a lot of time. ### Running ":" 100k times as benchmark $ time sh /tmp/my.sh "/my/random:/path:/here" : $(seq 1 10) /my/random:/path:/here real0m0.162s user0m0.133s sys 0m0.032s ### Running ensure_sane_path 100k times. $ time sh /tmp/my.sh "/my/random:/path:/here" ensure_sane_path $(seq 1 10) /my/random:/path:/here:/sbin:/usr/sbin:/bin:/usr/bin real0m0.586s user0m0.543s sys 0m0.045s ### Run with a larger input path. $ time sh /tmp/my.sh "$PATH" ensure_sane_path $(seq 1 10) /home/smoser/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin:/var/lib/snapd/snap/bin real0m0.635s user0m0.611s sys 0m0.026s So the cost of 10 runs of ensure_sane_path is somewhere in the realm of .5 seconds. That is .05 for the one run we'll do. very small. -- https://code.launchpad.net/~smoser/cloud-init/+git/cloud-init/+merge/345786 Your team cloud-init commiters is requested to review the proposed merge of ~smoser/cloud-init:fix/1771382-ds-identify-ensure-sane-path into cloud-init:master. ___ Mailing list: https://launchpad.net/~cloud-init-dev Post to : cloud-init-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~cloud-init-dev More help : https://help.launchpad.net/ListHelp
Re: [Cloud-init-dev] [Merge] ~smoser/cloud-init:fix/1771382-ds-identify-ensure-sane-path into cloud-init:master
Review: Approve Thanks -- https://code.launchpad.net/~smoser/cloud-init/+git/cloud-init/+merge/345786 Your team cloud-init commiters is requested to review the proposed merge of ~smoser/cloud-init:fix/1771382-ds-identify-ensure-sane-path into cloud-init:master. ___ Mailing list: https://launchpad.net/~cloud-init-dev Post to : cloud-init-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~cloud-init-dev More help : https://help.launchpad.net/ListHelp