yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #14150
[Bug 1316323] [NEW] cloud-init-single-module-fails-to-merge
Public bug reported:
I have a yaml file in a local directory (cloud-init.yaml) which contains
2 modules (write_files, runcmd). I am exercising the write_files module
using the following command:
$ sudo cloud-init --debug --file cloud-init.yaml single --name
cc_write_files
>From the debug output I can see that the local file (/home/mmorais
/cloud-init.yaml) is not getting merged into the master config file
(/var/lib/cloud/instance/cloud-config.txt).
2014-05-05 21:25:45,367 - __init__.py[DEBUG]: Merging using located merger 'DictMerger: (method=no_replace,recurse_str=False,recurse_dict=True,recurse_array=False,allow_delete=False)' since it had method '_on_dict'
2014-05-05 21:25:45,368 - util.py[DEBUG]: Reading from /home/mmorais/cloud-init.yaml (quiet=False)
2014-05-05 21:25:45,368 - util.py[DEBUG]: Read 407 bytes from /home/mmorais/cloud-init.yaml
2014-05-05 21:25:45,368 - util.py[DEBUG]: < #cloud-config
2014-05-05 21:25:45,368 - util.py[DEBUG]: < write_files:
2014-05-05 21:25:45,368 - util.py[DEBUG]: < - content: |
2014-05-05 21:25:45,368 - util.py[DEBUG]: < #!/bin/sh
2014-05-05 21:25:45,368 - util.py[DEBUG]: < date +"%s" > /home/y/tmp/now.txt
2014-05-05 21:25:45,368 - util.py[DEBUG]: < path: /home/y/tmp/upload-boot-time.sh
2014-05-05 21:25:45,368 - util.py[DEBUG]: < permissions: '0755'
2014-05-05 21:25:45,369 - util.py[DEBUG]: < runcmd:
2014-05-05 21:25:45,369 - util.py[DEBUG]: < - ['/home/y/tmp/upload-boot-time.sh']
2014-05-05 21:25:45,369 - util.py[DEBUG]: Attempting to load yaml from string of length 407 with allowed root types (<type 'dict'>,)
2014-05-05 21:25:45,371 - util.py[DEBUG]: Reading from /var/lib/cloud/instance/cloud-config.txt (quiet=False)
2014-05-05 21:25:45,371 - util.py[DEBUG]: Read 0 bytes from /var/lib/cloud/instance/cloud-config.txt
2014-05-05 21:25:45,371 - util.py[DEBUG]: Attempting to load yaml from string of length 0 with allowed root types (<type 'dict'>,)
2014-05-05 21:25:45,371 - util.py[DEBUG]: load_yaml given empty string, returning default
As a workaround I am copying /home/mmorais/cloud-init.yaml to
/var/lib/cloud/instance/cloud-config.txt which defeats the purpose of
being able to run cloud-init on arbitrary files for testing.
Also note that the command above does not work at all unless I specify
*cc_write_files* instead of *write_files*.
I am running cloud-init (0.7.4).
** Affects: cloud-init
Importance: Undecided
Status: New
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to cloud-init.
https://bugs.launchpad.net/bugs/1316323
Title:
cloud-init-single-module-fails-to-merge
Status in Init scripts for use on cloud images:
New
Bug description:
I have a yaml file in a local directory (cloud-init.yaml) which
contains 2 modules (write_files, runcmd). I am exercising the
write_files module using the following command:
$ sudo cloud-init --debug --file cloud-init.yaml single --name
cc_write_files
From the debug output I can see that the local file (/home/mmorais
/cloud-init.yaml) is not getting merged into the master config file
(/var/lib/cloud/instance/cloud-config.txt).
2014-05-05 21:25:45,367 - __init__.py[DEBUG]: Merging using located merger 'DictMerger: (method=no_replace,recurse_str=False,recurse_dict=True,recurse_array=False,allow_delete=False)' since it had method '_on_dict'
2014-05-05 21:25:45,368 - util.py[DEBUG]: Reading from /home/mmorais/cloud-init.yaml (quiet=False)
2014-05-05 21:25:45,368 - util.py[DEBUG]: Read 407 bytes from /home/mmorais/cloud-init.yaml
2014-05-05 21:25:45,368 - util.py[DEBUG]: < #cloud-config
2014-05-05 21:25:45,368 - util.py[DEBUG]: < write_files:
2014-05-05 21:25:45,368 - util.py[DEBUG]: < - content: |
2014-05-05 21:25:45,368 - util.py[DEBUG]: < #!/bin/sh
2014-05-05 21:25:45,368 - util.py[DEBUG]: < date +"%s" > /home/y/tmp/now.txt
2014-05-05 21:25:45,368 - util.py[DEBUG]: < path: /home/y/tmp/upload-boot-time.sh
2014-05-05 21:25:45,368 - util.py[DEBUG]: < permissions: '0755'
2014-05-05 21:25:45,369 - util.py[DEBUG]: < runcmd:
2014-05-05 21:25:45,369 - util.py[DEBUG]: < - ['/home/y/tmp/upload-boot-time.sh']
2014-05-05 21:25:45,369 - util.py[DEBUG]: Attempting to load yaml from string of length 407 with allowed root types (<type 'dict'>,)
2014-05-05 21:25:45,371 - util.py[DEBUG]: Reading from /var/lib/cloud/instance/cloud-config.txt (quiet=False)
2014-05-05 21:25:45,371 - util.py[DEBUG]: Read 0 bytes from /var/lib/cloud/instance/cloud-config.txt
2014-05-05 21:25:45,371 - util.py[DEBUG]: Attempting to load yaml from string of length 0 with allowed root types (<type 'dict'>,)
2014-05-05 21:25:45,371 - util.py[DEBUG]: load_yaml given empty string, returning default
As a workaround I am copying /home/mmorais/cloud-init.yaml to
/var/lib/cloud/instance/cloud-config.txt which defeats the purpose of
being able to run cloud-init on arbitrary files for testing.
Also note that the command above does not work at all unless I specify
*cc_write_files* instead of *write_files*.
I am running cloud-init (0.7.4).
To manage notifications about this bug go to:
https://bugs.launchpad.net/cloud-init/+bug/1316323/+subscriptions
Follow ups
References