check cluster having hosts and host having networks
Change-Id: I99a9e7918d99053df7de43f420fda6d073be1ffb
This commit is contained in:
parent
c7586ac86e
commit
06e90df04a
@ -1166,6 +1166,10 @@ def validate_clusterhost(session, clusterhost):
|
||||
|
||||
|
||||
def validate_cluster(session, cluster):
|
||||
if not cluster.clusterhosts:
|
||||
raise exception.InvalidParameter(
|
||||
'%s does not have any hosts' % cluster.name
|
||||
)
|
||||
cluster_roles = [
|
||||
flavor_role.role
|
||||
for flavor_role in cluster.flavor.flavor_roles
|
||||
|
@ -235,6 +235,10 @@ def is_host_editable(
|
||||
|
||||
|
||||
def validate_host(session, host):
|
||||
if not host.host_networks:
|
||||
raise exception.InvalidParameter(
|
||||
'%s does not have any network' % host.name
|
||||
)
|
||||
mgmt_interface_set = False
|
||||
for host_network in host.host_networks:
|
||||
if host_network.is_mgmt:
|
||||
|
Loading…
x
Reference in New Issue
Block a user