diff options
-rwxr-xr-x | ansible-server/src/main/ansible-server/AnsibleModule.py | 6 | ||||
-rwxr-xr-x | ansible-server/src/main/ansible-server/BuildHostFile.py | 12 | ||||
-rwxr-xr-x | ansible-server/src/main/ansible-server/RestServer.py | 24 | ||||
-rw-r--r-- | docs/release-notes.rst | 21 |
4 files changed, 38 insertions, 25 deletions
diff --git a/ansible-server/src/main/ansible-server/AnsibleModule.py b/ansible-server/src/main/ansible-server/AnsibleModule.py index 71d0c059..3985ee28 100755 --- a/ansible-server/src/main/ansible-server/AnsibleModule.py +++ b/ansible-server/src/main/ansible-server/AnsibleModule.py @@ -6,7 +6,9 @@ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Copyright (C) 2019 Amdocs -* ============================================================================= +* ================================================================================ +* Copyright (C) 2019 Orange +* ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -86,7 +88,7 @@ def ansibleSysCall (inventory_path, playbook_path, nodelist, mandatory, envparam ok_flag = line.split(':')[1].strip().split('=')[1].split('changed')[0].strip() changed_flag = line.split(':')[1].strip().split('=')[2].split('unreachable')[0].strip() unreachable_flag = line.split(':')[1].strip().split('=')[3].split('failed')[0].strip() - failed_flag = line.split(':')[1].strip().split('=')[4].strip() + failed_flag = line.split(':')[1].strip().split('=')[4].split('skipped')[0].strip() retval[ip_address]=[ok_flag, changed_flag, unreachable_flag, failed_flag] if "PLAY RECAP" in line: ParseFlag = True diff --git a/ansible-server/src/main/ansible-server/BuildHostFile.py b/ansible-server/src/main/ansible-server/BuildHostFile.py index a49f94aa..64e184d2 100755 --- a/ansible-server/src/main/ansible-server/BuildHostFile.py +++ b/ansible-server/src/main/ansible-server/BuildHostFile.py @@ -6,7 +6,9 @@ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Copyright (C) 2019 Amdocs -* ============================================================================= +* ================================================================================ +* Copyright (C) 2019 Orange +* ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -77,10 +79,8 @@ def buildHostsSysCall(JsonInput, run_path, inventory_type): output_file.write ("\n[%svip]\n" % Type ) if inventory_type == "None": output_file.write ("%s\n" % (FloatingIP) ) - elif inventory_type == "VNFC": + elif inventory_type == "VNFC" or inventory_type == "VM": output_file.write ("%s ansible_host=%s\n" % (NE_ID_VIP, FloatingIP) ) - elif inventory_type == "VM": - output_file.write ("%s ansible_host=%s\n" % (NE_ID_VIP[0:13], FloatingIP) ) output_file.write ("\n[%s]\n" % Type ) Site = NodeList['site'] @@ -96,10 +96,8 @@ def buildHostsSysCall(JsonInput, run_path, inventory_type): #print ("vm: " + Name + ": " + IpAddr) if inventory_type == "None": output_file.write ("%s\n" % (IpAddr) ) - elif inventory_type == "VNFC": + elif inventory_type == "VNFC" or inventory_type == "VM": output_file.write ("%s ansible_host=%s\n" % (Name, IpAddr) ) - elif inventory_type == "VM": - output_file.write ("%s ansible_host=%s\n" % (Name[0:13], IpAddr) ) # print site list output_file.write ("\n[%s:children]\n" % Site ) diff --git a/ansible-server/src/main/ansible-server/RestServer.py b/ansible-server/src/main/ansible-server/RestServer.py index 2b4da335..8f5aa7ef 100755 --- a/ansible-server/src/main/ansible-server/RestServer.py +++ b/ansible-server/src/main/ansible-server/RestServer.py @@ -6,7 +6,9 @@ * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Copyright (C) 2017 Amdocs -* ============================================================================= +* ================================================================================ +* Copyright (C) 2019 Orange +* ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -18,7 +20,7 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. -* +* * ============LICENSE_END========================================================= */ ''' @@ -554,9 +556,13 @@ def process_vnf_playbook(input_json, Id, EnvParameters, time_now): else: cherrypy.log("Successfully created the directory %s " % path) + # location of host file - Default - HostFile = PlaybookDir + "/inventory/" + VNF_instance + "hosts" - cherrypy.log("HostFile: " + HostFile) + HostFile = "inventory/" + VNF_instance + "hosts" + HostFilePath = PlaybookDir + "/" + HostFile + cherrypy.log("HostFile: " + HostFilePath) + + # buildInventorySysCall(ANSIBLE_PATH, ANSIBLE_INV, NodeList, PlaybookDir, HostFile, hostgrouplist, hostnamelist) # if NodeList and InventoryNames need to build host file if HaveInventoryNames and HaveNodeList: @@ -568,8 +574,8 @@ def process_vnf_playbook(input_json, Id, EnvParameters, time_now): "StatusMessage": "NodeList: Missing vnfc-type field"} # Having been built now copy new file to correct file - shutil.copy(PlaybookDir + "/host_file.txt", HostFile) - cherrypy.log("Copying Generated host file to: " + HostFile) + shutil.copy(PlaybookDir + "/host_file.txt", HostFilePath) + cherrypy.log("Copying Generated host file to: " + HostFilePath) if 'Timeout' in input_json: timeout = int(input_json['Timeout']) @@ -657,14 +663,14 @@ def process_vnf_playbook(input_json, Id, EnvParameters, time_now): f.close() # Check that HostFile exists - if not os.path.isfile(HostFile): - cherrypy.log("Inventory file Not Found: " + HostFile) + if not os.path.isfile(HostFilePath): + cherrypy.log("Inventory file Not Found: " + HostFilePath) return {"StatusCode": 101, "StatusMessage": "PLAYBOOK INVENTORY FILE NOT FOUND"} # Cannot use thread because ansible module uses signals which are only supported in main thread. # So use multiprocess with shared object p = Process(target=RunAnsible_Playbook, - args=(callback, Id, HostFile, PlaybookDir + '/' + PlayBookFile, + args=(callback, Id, "../" + HostFile, "site.yml", NodeList, TestRecord, PlaybookDir + "/" + PlayBookFunction, ArchiveFlag)) p.start() ActiveProcess[Id] = p diff --git a/docs/release-notes.rst b/docs/release-notes.rst index 75bf44f4..84ff1cdd 100644 --- a/docs/release-notes.rst +++ b/docs/release-notes.rst @@ -34,6 +34,14 @@ The full list of bug fixes in the CCSDK Dublin release may be found at <https:// **Known Issues** The full list of known issues in CCSDK may be found in the ONAP Jira at <https://jira.onap.org/issues/?filter=11341> +**Security Notes** + +*Fixed Security Issues* + +*Known Security Issues* + +*Known Vulnerabilities in Used Modules* + Quick Links: - `CCSDK project page <https://wiki.onap.org/display/DW/Common+Controller+SDK+Project>`_ @@ -72,9 +80,9 @@ The full list of known issues in CCSDK may be found in the ONAP Jira at <https:/ Quick Links: - `CCSDK project page <https://wiki.onap.org/display/DW/Common+Controller+SDK+Project>`_ - + - `Passing Badge information for CCSDK <https://bestpractices.coreinfrastructure.org/en/projects/1630>`_ - + - `Project Vulnerability Review Table for CCSDK <https://wiki.onap.org/pages/viewpage.action?pageId=45300857>`_ Version: 0.3.2 @@ -108,9 +116,9 @@ The full list of known issues in CCSDK may be found in the ONAP Jira at <https:/ Quick Links: - `CCSDK project page <https://wiki.onap.org/display/DW/Common+Controller+SDK+Project>`_ - + - `Passing Badge information for CCSDK <https://bestpractices.coreinfrastructure.org/en/projects/1630>`_ - + - `Project Vulnerability Review Table for CCSDK <https://wiki.onap.org/pages/viewpage.action?pageId=45300857>`_ Version: 0.2.4 @@ -164,9 +172,9 @@ CCSDK code has been formally scanned during build time using NexusIQ and all Cri Quick Links: - `CCSDK project page <https://wiki.onap.org/display/DW/Common+Controller+SDK+Project>`_ - + - `Passing Badge information for CCSDK <https://bestpractices.coreinfrastructure.org/en/projects/1630>`_ - + - `Project Vulnerability Review Table for CCSDK <https://wiki.onap.org/pages/viewpage.action?pageId=28379011>`_ **Upgrade Notes** @@ -220,4 +228,3 @@ The Common Controller SDK provides the following functionality : **Deprecation Notes** **Other** - |