util.subp regression: no longer accept commands as string
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-images |
Fix Released
|
Medium
|
Dan Watkins | ||
cloud-init |
Fix Released
|
High
|
Chad Smith | ||
cloud-init (Ubuntu) |
Fix Released
|
Critical
|
Unassigned |
Bug Description
Revision 46cb6716c27d449
To test:
# failure path
$ python -c 'from cloudinit.util import subp; print(subp("echo hi mom", shell=True))'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "cloudinit/
cmd=args)
cloudinit.
Command: echo hi mom
Exit code: 127
Reason: -
Stdout:
Stderr: c: 1: c: e: not found
# revert commit causing regression
$ git diff 46cb6716c27d449
$ patch -p1 < patch1
patching file cloudinit/util.py
patching file tests/unittests
$ python -c 'from cloudinit.util import subp; print(subp("echo hi mom", shell=True))'
(u'hi mom\n', u'')
This also caused symptoms like the following Azure failure described in bug 1755565.
Related bugs:
* bug 1755565: Unable to deploy azure template with Ubuntu18.04 Daily
* bug 1754495: get_hostname on DataSourceAzure fails
Related branches
- Server Team CI bot: Approve (continuous-integration)
- Scott Moser: Pending requested
-
Diff: 1999 lines (+765/-204)46 files modified.pylintrc (+11/-1)
cloudinit/cloud.py (+3/-2)
cloudinit/cmd/main.py (+29/-6)
cloudinit/cmd/tests/test_main.py (+161/-0)
cloudinit/config/cc_keys_to_console.py (+1/-3)
cloudinit/config/cc_runcmd.py (+4/-2)
cloudinit/config/cc_salt_minion.py (+59/-23)
cloudinit/config/cc_set_hostname.py (+35/-6)
cloudinit/config/cc_ssh_authkey_fingerprints.py (+4/-5)
cloudinit/distros/arch.py (+1/-4)
cloudinit/distros/freebsd.py (+6/-0)
cloudinit/distros/opensuse.py (+2/-3)
cloudinit/sources/DataSourceAzure.py (+2/-0)
cloudinit/sources/DataSourceOpenNebula.py (+1/-4)
cloudinit/sources/__init__.py (+17/-4)
cloudinit/sources/tests/test_init.py (+69/-1)
cloudinit/stages.py (+1/-2)
cloudinit/tests/helpers.py (+13/-0)
cloudinit/tests/test_util.py (+97/-0)
cloudinit/url_helper.py (+2/-2)
cloudinit/util.py (+32/-14)
config/cloud.cfg.tmpl (+1/-1)
debian/changelog (+22/-0)
doc/rtd/topics/capabilities.rst (+8/-6)
doc/rtd/topics/debugging.rst (+31/-26)
doc/rtd/topics/network-config.rst (+2/-2)
doc/rtd/topics/tests.rst (+10/-10)
tests/cloud_tests/bddeb.py (+1/-1)
tests/cloud_tests/platforms/ec2/__init__.py (+0/-0)
tests/cloud_tests/platforms/lxd/__init__.py (+0/-0)
tests/cloud_tests/platforms/lxd/platform.py (+0/-4)
tests/cloud_tests/platforms/nocloudkvm/__init__.py (+0/-0)
tests/cloud_tests/platforms/nocloudkvm/instance.py (+1/-1)
tests/cloud_tests/platforms/nocloudkvm/platform.py (+0/-4)
tests/cloud_tests/platforms/platforms.py (+12/-2)
tests/cloud_tests/testcases/modules/salt_minion.py (+5/-0)
tests/cloud_tests/testcases/modules/salt_minion.yaml (+4/-1)
tests/cloud_tests/util.py (+5/-1)
tests/unittests/test_datasource/test_azure.py (+15/-0)
tests/unittests/test_handler/test_handler_bootcmd.py (+7/-12)
tests/unittests/test_handler/test_handler_ntp.py (+6/-12)
tests/unittests/test_handler/test_handler_resizefs.py (+3/-11)
tests/unittests/test_handler/test_handler_runcmd.py (+4/-10)
tests/unittests/test_handler/test_handler_set_hostname.py (+53/-4)
tests/unittests/test_handler/test_schema.py (+7/-14)
tests/unittests/test_util.py (+18/-0)
description: | updated |
Changed in cloud-init: | |
importance: | Undecided → High |
assignee: | nobody → Chad Smith (chad.smith) |
status: | New → In Progress |
Changed in cloud-init: | |
status: | In Progress → Fix Committed |
description: | updated |
Changed in cloud-images: | |
status: | In Progress → Fix Released |
This is fixed in 18.1-17- g97012fbb- 0ubuntu1