ó oBú]c@s8dZddlmZmZddlmZddlmZddlm Z ddl Z ddl m Z egZ i dd 6d d 6d d 6e dƒd6e d6e dƒgd6ed6dd6iidd6iidd6idd6d6idd6gd6d6ed6ed6dd6gd6d6d 6ZeeƒZd!„ZdS("sERuncmd: run arbitrary commands at rc.local with output to the consoleiÿÿÿÿ(tget_schema_doctvalidate_cloudconfig_schema(t ALL_DISTROS(t PER_INSTANCE(tutilN(tdedentt cc_runcmdtidtRuncmdtnamesRun arbitrary commandsttitles¬ Run arbitrary commands at a rc.local like level with output to the console. Each item can be either a list or a string. If the item is a list, it will be properly executed as if passed to ``execve()`` (with the first arg as the command). If the item is a string, it will be written to a file and interpreted using ``sh``. .. note:: all commands must be proper yaml, so you have to quote any characters yaml would eat (':' can be problematic) .. note:: when writing files, do not use /tmp dir as it races with systemd-tmpfiles-clean LP: #1707222. Use /run/somedir instead. t descriptiontdistross runcmd: - [ ls, -l, / ] - [ sh, -xc, "echo $(date) ': hello world!'" ] - [ sh, -c, echo "=========hello world'=========" ] - ls -l /root - [ wget, "http://example.org", -O, /tmp/index.html ] texamplest frequencytobjectttypetarraytstringtitemstoneOftadditionalItemstadditionalPropertiesitminItemstrequiredtruncmdt propertiescCs©d|kr |jd|ƒdSt|tƒtjj|jdƒdƒ}|d}y&tj|ƒ}tj ||dƒWn't k r¤tj |d||ƒnXdS(NRs:Skipping module named %s, no 'runcmd' key in configurationtscriptsiÀs"Failed to shellify %s into file %s( tdebugRtschematostpathtjoint get_ipathRtshellifyt write_filet Exceptiontlogexc(R tcfgtcloudtlogt_argstout_fntcmdtcontent((s>/usr/lib/python2.7/site-packages/cloudinit/config/cc_runcmd.pythandleQs     (t__doc__tcloudinit.config.schemaRRtcloudinit.distrosRtcloudinit.settingsRt cloudinitRRttextwrapRR tFalseRR-(((s>/usr/lib/python2.7/site-packages/cloudinit/config/cc_runcmd.pyt s<