Change self.node to self.nodes in model_root

networkx removed G.node in version 2.4[1]
G.node was replaced by G.nodes since version 2.0[2],
and supports Python 2.7, 3.5, 3.6 and 3.7 from 2.2
so the lower constraint version is 2.2.
lib task_flow also invokes lib networkx,
task_flow version is also needed to be updated.
[1]: https://networkx.github.io/documentation/stable/release/release_2.4.html
[2]: https://networkx.github.io/documentation/stable/release/release_2.0.html
Change-Id: I268bcf57ec977bd8132a9f1573b28b681cb4ce1e
Closes-Bug: #1854132
This commit is contained in:
licanwei 2019-11-27 15:25:25 +08:00
parent 89055577e6
commit 4a269ba039
3 changed files with 8 additions and 8 deletions

View File

@ -64,7 +64,7 @@ msgpack==0.5.6
munch==2.2.0
netaddr==0.7.19
netifaces==0.10.6
networkx==1.11
networkx==2.2
openstackdocstheme==1.20.0
openstacksdk==0.12.0
os-api-ref===1.4.0
@ -145,7 +145,7 @@ sqlparse==0.2.4
statsd==3.2.2
stestr==2.0.0
stevedore==1.28.0
taskflow==3.1.0
taskflow==3.7.1
Tempita==0.5.2
tenacity==4.9.0
testresources==2.0.1

View File

@ -42,9 +42,9 @@ python-ironicclient>=2.5.0 # Apache-2.0
six>=1.11.0 # MIT
SQLAlchemy>=1.2.5 # MIT
stevedore>=1.28.0 # Apache-2.0
taskflow>=3.1.0 # Apache-2.0
taskflow>=3.7.1 # Apache-2.0
WebOb>=1.8.5 # MIT
WSME>=0.9.2 # MIT
networkx>=1.11;python_version>='3.4' # BSD
networkx>=2.2;python_version>='3.4' # BSD
microversion_parse>=0.2.1 # Apache-2.0
futurist>=1.8.0 # Apache-2.0

View File

@ -171,7 +171,7 @@ class ModelRoot(nx.DiGraph, base.Model):
def _get_by_uuid(self, uuid):
try:
return self.node[uuid]['attr']
return self.nodes[uuid]['attr']
except Exception as exc:
LOG.exception(exc)
raise exception.ComputeResourceNotFound(name=uuid)
@ -466,14 +466,14 @@ class StorageModelRoot(nx.DiGraph, base.Model):
def _get_by_uuid(self, uuid):
try:
return self.node[uuid]['attr']
return self.nodes[uuid]['attr']
except Exception as exc:
LOG.exception(exc)
raise exception.StorageResourceNotFound(name=uuid)
def _get_by_name(self, name):
try:
return self.node[name]['attr']
return self.nodes[name]['attr']
except Exception as exc:
LOG.exception(exc)
raise exception.StorageResourceNotFound(name=name)
@ -648,7 +648,7 @@ class BaremetalModelRoot(nx.DiGraph, base.Model):
def _get_by_uuid(self, uuid):
try:
return self.node[uuid]['attr']
return self.nodes[uuid]['attr']
except Exception as exc:
LOG.exception(exc)
raise exception.BaremetalResourceNotFound(name=uuid)