diff options
author | Haibin Huang <haibin.huang@intel.com> | 2018-04-26 00:39:42 +0800 |
---|---|---|
committer | Haibin Huang <haibin.huang@intel.com> | 2018-04-28 17:08:24 +0800 |
commit | c4a3c5f929209f032f7a47c2f96e903d97bb0cfe (patch) | |
tree | 1ee09cfd09ff396acdd469ee88c9328e345ab37b | |
parent | 1f98be8e933753c1ad97ce0fd8883d95899e212a (diff) |
Modify inject file path to file data
Change-Id: Ie8368560919d1ce8392467e3b80dced0f47e1a3b
Issue-ID: VFC-657
Signed-off-by: Haibin Huang <haibin.huang@intel.com>
-rw-r--r-- | lcm/lcm/pub/vimapi/adaptor.py | 9 | ||||
-rw-r--r-- | lcm/lcm/samples/tests.py | 13 |
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": { |