Fixes from PR review
Added PartialSuccess logic for ApplyNodePlatform task A few stylistic updates
This commit is contained in:
parent
e6715a0510
commit
b097054e5e
@ -1038,7 +1038,7 @@ class MaasTaskRunner(drivers.DriverTaskRunner):
|
||||
# Render the string of all kernel params for the node
|
||||
kp_string = ""
|
||||
|
||||
for k,v in getattr(node, 'kernel_params', {}).items():
|
||||
for k, v in getattr(node, 'kernel_params', {}).items():
|
||||
if v == 'True':
|
||||
kp_string = kp_string + " %s" % (k)
|
||||
else:
|
||||
@ -1093,7 +1093,9 @@ class MaasTaskRunner(drivers.DriverTaskRunner):
|
||||
self.logger.error("Error configuring static tags for node %s: %s" % (node.name, str(ex3)))
|
||||
continue
|
||||
|
||||
if failed:
|
||||
if worked and failed:
|
||||
final_result = hd_fields.ActionResult.PartialSuccess
|
||||
elif failed:
|
||||
final_result = hd_fields.ActionResult.Failure
|
||||
else:
|
||||
final_result = hd_fields.ActionResult.Success
|
||||
|
@ -42,7 +42,9 @@ class Tag(model_base.ResourceBase):
|
||||
system_id_list = []
|
||||
|
||||
for n in resp_json:
|
||||
system_id_list.append(n.get('system_id'))
|
||||
system_id = n.get('system_id', None)
|
||||
if system_id is not None:
|
||||
system_id_list.append(system_id)
|
||||
|
||||
return system_id_list
|
||||
else:
|
||||
@ -100,7 +102,7 @@ class Tag(model_base.ResourceBase):
|
||||
|
||||
refined_dict = {k: obj_dict.get(k, None) for k in cls.fields}
|
||||
|
||||
if 'name' in obj_dict.keys():
|
||||
if 'name' in obj_dict:
|
||||
refined_dict['resource_id'] = obj_dict.get('name')
|
||||
|
||||
i = cls(api_client, **refined_dict)
|
||||
|
@ -310,7 +310,7 @@ class YamlIngester(IngesterPlugin):
|
||||
model.kernel = platform.get('kernel', None)
|
||||
|
||||
model.kernel_params = {}
|
||||
for k,v in platform.get('kernel_params', {}).items():
|
||||
for k, v in platform.get('kernel_params', {}).items():
|
||||
model.kernel_params[k] = v
|
||||
|
||||
model.primary_network = spec.get('primary_network', None)
|
||||
|
@ -483,7 +483,7 @@ class Orchestrator(object):
|
||||
if node_platform_task.get_result() in [hd_fields.ActionResult.Success,
|
||||
hd_fields.ActionResult.PartialSuccess]:
|
||||
worked = True
|
||||
elif node_platform_task.get_result() in [hd_fields.ActionResult.Failure,
|
||||
if node_platform_task.get_result() in [hd_fields.ActionResult.Failure,
|
||||
hd_fields.ActionResult.PartialSuccess]:
|
||||
failed = True
|
||||
else:
|
||||
|
Loading…
x
Reference in New Issue
Block a user