Implements a Dummy vim plugin.
"""
-import yaml
-from osm_ro_plugin import vimconn
-from uuid import uuid4
from copy import deepcopy
import logging
-from random import randrange
+from random import SystemRandom
+from uuid import uuid4
+
+from osm_ro_plugin import vimconn
+import yaml
+
__author__ = "Alfonso Tierno"
__date__ = "2020-04-20"
start,
image_id,
flavor_id,
+ affinity_group_list,
net_list,
cloud_config=None,
disk_list=None,
if iface.get("type") in ("SR-IOV", "PCI-PASSTHROUGH") and self.config.get(
"sdn-port-mapping"
):
- compute_index = randrange(len(self.config["sdn-port-mapping"]))
- port_index = randrange(
+ compute_index = SystemRandom().randrange(
+ len(self.config["sdn-port-mapping"])
+ )
+ port_index = SystemRandom().randrange(
len(self.config["sdn-port-mapping"][compute_index]["ports"])
)
interface["compute_node"] = self.config["sdn-port-mapping"][
return self.vms[vm_id]
- def delete_vminstance(self, vm_id, created_items=None):
+ def delete_vminstance(self, vm_id, created_items=None, volumes_to_hold=None):
if vm_id not in self.vms:
raise vimconn.VimConnNotFoundException(
"vm with id {} not found".format(vm_id)