summaryrefslogtreecommitdiffstats
path: root/lcm
diff options
context:
space:
mode:
authorYan Yang <yangyanyj@chinamobile.com>2018-05-02 06:50:58 +0000
committerGerrit Code Review <gerrit@onap.org>2018-05-02 06:50:58 +0000
commit38dc7ecdb409b719dd9796a3042886e472a50192 (patch)
treea5ce9022b011f2ca8e19cc8c5750adebb08565df /lcm
parent575bd01c3048274e504798da568dd0aa5c2c2b1d (diff)
parentc4a3c5f929209f032f7a47c2f96e903d97bb0cfe (diff)
Merge "Modify inject file path to file data"
Diffstat (limited to 'lcm')
-rw-r--r--lcm/lcm/pub/vimapi/adaptor.py9
-rw-r--r--lcm/lcm/samples/tests.py13
2 files changed, 9 insertions, 13 deletions
diff --git a/lcm/lcm/pub/vimapi/adaptor.py b/lcm/lcm/pub/vimapi/adaptor.py
index 9956f7e7..6eeaf73a 100644
--- a/lcm/lcm/pub/vimapi/adaptor.py
+++ b/lcm/lcm/pub/vimapi/adaptor.py
@@ -317,13 +317,8 @@ def create_vm(vim_cache, res_cache, data, vm, do_notify, res_type):
param["nicArray"].append({
"portId": get_res_id(res_cache, RES_PORT, cp_id)
})
- # TODO: use config drive
- for inject_data in ignore_case_get(vm["properties"], "inject_files"):
- for key, value in inject_data.items():
- param["contextArray"].append({
- "fileName": key,
- "fileData": value
- })
+ param["contextArray"] = ignore_case_get(vm["properties"], "inject_files")
+ logger.debug("contextArray:%s", param["contextArray"])
for vol_data in ignore_case_get(vm, "volume_storages"):
vol_id = vol_data["volume_storage_id"]
param["volumeArray"].append({
diff --git a/lcm/lcm/samples/tests.py b/lcm/lcm/samples/tests.py
index f834e7ca..3a923ab7 100644
--- a/lcm/lcm/samples/tests.py
+++ b/lcm/lcm/samples/tests.py
@@ -53,12 +53,6 @@ inst_res_data = {
"file": "ubuntu_16.04"
},
],
- "inject_files": [
- {
- "source_path": "artifacts/keys/authorized_keys",
- "dest_path": "/home/ubuntu/.ssh/authorized_keys"
- }
- ],
"image_file": "cirros.img",
"local_storages": [
"intel_local_storages_1"
@@ -74,6 +68,13 @@ inst_res_data = {
"properties": {
"user_data": "just test user data",
"meta_data": "just test meta data",
+ "inject_files": [
+ {
+ "source_path": "artifacts/keys/authorized_keys",
+ "source_data_base64": "c3NoLXJzYSBBQUFBQjNOemFDMXljMkVBQUFBREFRQUJBQUFCQVFER3g2U0tyQXVDejFWOEtHZXZa\ndWVrc0xkV29QV0pQNnozcjI5WjdUbVBWRU9qTSs3UElQZVNzMkJWUngzcm5IWkJBbGFzTXJaK2ZK\nQlMyNXRzOXZmQytJdGV6UWFoL2hyOXZya213eENSNTRMYjg0cG9XK3NUb1BlRjZpNWVaWTdXK2pX\nSmZMYUZTRng5ZDJ2cDR6ZXMvZk9sVDNOdllDWGJuLzNRZHJ5UW9HbDdWRkk4b2VtWnlwVmNpa1pY\nRWxKZWVLZ0FWZFN3bnJ6dXF0Ty90bWJYY0FlU2JZdlZqa2k4eXdZY3NXTVZNWVdVV2hoKzFCQUI2\na1huVHNJV3F6cnEwUGZ2eSs4MVdEd3RpcXNxbWQ5M0hZOGhFMHNjQnJYRkJaelFTL0FZZklGQmxF\ndUZOZExjemNobnRqYlowbjdkbURYazh6SHRDWllOazdrd2I4ay8gbHVsaWFuaGFvQGxsdS1udWMx\nCg==\n",
+ "dest_path": "/home/ubuntu/.ssh/authorized_keys"
+ }
+ ],
"configurable_properties": {
"test": {
"additional_vnfc_configurable_properties": {