projects
/
osm
/
RO.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update from master
[osm/RO.git]
/
RO-plugin
/
osm_ro_plugin
/
vim_dummy.py
diff --git
a/RO-plugin/osm_ro_plugin/vim_dummy.py
b/RO-plugin/osm_ro_plugin/vim_dummy.py
index
fbc6bfe
..
dc0e00e
100644
(file)
--- a/
RO-plugin/osm_ro_plugin/vim_dummy.py
+++ b/
RO-plugin/osm_ro_plugin/vim_dummy.py
@@
-22,7
+22,7
@@
Implements a Dummy vim plugin.
from copy import deepcopy
import logging
from copy import deepcopy
import logging
-from random import
randrange
+from random import
SystemRandom
from uuid import uuid4
from osm_ro_plugin import vimconn
from uuid import uuid4
from osm_ro_plugin import vimconn
@@
-379,8
+379,10
@@
class VimDummyConnector(vimconn.VimConnector):
if iface.get("type") in ("SR-IOV", "PCI-PASSTHROUGH") and self.config.get(
"sdn-port-mapping"
):
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"][
len(self.config["sdn-port-mapping"][compute_index]["ports"])
)
interface["compute_node"] = self.config["sdn-port-mapping"][