X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=osm_ro%2Fvimconn_opennebula.py;h=2e63d53a481c26d8d17c42a472f1fb09c56b7dd7;hb=31e121f56d87b6be951caa550b2884ed5908cd92;hp=eaf3021a055aac472afff1ac7efb87c2b8181cee;hpb=ea2a73ee9c827a6a3559c715423cb1a63f9123d8;p=osm%2FRO.git diff --git a/osm_ro/vimconn_opennebula.py b/osm_ro/vimconn_opennebula.py index eaf3021a..2e63d53a 100644 --- a/osm_ro/vimconn_opennebula.py +++ b/osm_ro/vimconn_opennebula.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- ## -# Copyright 2017 Telefónica Digital España S.L.U. +# Copyright 2017 Telefonica Digital Spain S.L.U. # This file is part of ETSI OSM # All Rights Reserved. # @@ -26,7 +26,7 @@ vimconnector implements all the methods to interact with OpenNebula using the XML-RPC API. """ __author__ = "Jose Maria Carmona Perez,Juan Antonio Hernando Labajo, Emilio Abraham Garrido Garcia,Alberto Florez " \ - "Pages, Andres Pozo Muñoz, Santiago Perez Marin, Onlife Networks Telefonica I+D Product Innovation " + "Pages, Andres Pozo Munoz, Santiago Perez Marin, Onlife Networks Telefonica I+D Product Innovation " __date__ = "$13-dec-2017 11:09:29$" import vimconn import requests @@ -293,9 +293,9 @@ class vimconnector(vimconn.vimconnector): network_id_filter = None for network in networkList: match = False - if network.name == network_name_filter and network.id == network_id_filter: + if network.name == network_name_filter and str(network.id) == str(network_id_filter): match = True - if network_name_filter is None and network.id == network_id_filter: + if network_name_filter is None and str(network.id) == str(network_id_filter): match = True if network_id_filter is None and network.name == network_name_filter: match = True @@ -429,9 +429,9 @@ class vimconnector(vimconn.vimconnector): image_id_filter = None for image in image_pool: match = False - if str(image_name_filter) == str(image.name) and image.id == image_id_filter: + if str(image_name_filter) == str(image.name) and str(image.id) == str(image_id_filter): match = True - if image_name_filter is None and image.id == image_id_filter: + if image_name_filter is None and str(image.id) == str(image_id_filter): match = True if image_id_filter is None and str(image_name_filter) == str(image.name): match = True @@ -453,7 +453,7 @@ class vimconnector(vimconn.vimconnector): name: net_id: network uuid to connect vpci: virtual vcpi to assign - model: interface model, virtio, e2000, ... + model: interface model, virtio, e1000, ... mac_address: use: 'data', 'bridge', 'mgmt' type: 'virtual', 'PF', 'VF', 'VFnotShared' @@ -506,9 +506,10 @@ class vimconnector(vimconn.vimconnector): try: client = oca.Client(self.user + ':' + self.passwd, self.url) vm_pool = oca.VirtualMachinePool(client) + vm_pool.info() vm_exist = False for i in vm_pool: - if i.id == vm_id: + if str(i.id) == str(vm_id): vm_exist = True break if not vm_exist: @@ -555,7 +556,7 @@ class vimconnector(vimconn.vimconnector): vm_exist = False vm_element = None for i in vm_pool: - if i.id == vm_id: + if str(i.id) == str(vm_id): vm_exist = True vm_element = i break @@ -652,3 +653,4 @@ class vimconnector(vimconn.vimconnector): # return console_dict # except vimconn.vimconnException as e: # self.logger.error(e) +