Fix power_type field and power_address limitation
Change-Id: Iaa71d87c6627cada4a0a85d7eb087b57dc25d3bc
diff --git a/_modules/maas.py b/_modules/maas.py
index 1e974cb..9ba76e5 100644
--- a/_modules/maas.py
+++ b/_modules/maas.py
@@ -411,9 +411,10 @@
'hostname': name,
'architecture': machine_data.get('architecture', 'amd64/generic'),
'mac_addresses': machine_pxe_mac,
- 'power_type': machine_data.get('power_type', 'ipmi'),
- 'power_parameters_power_address': power_data['power_address'],
+ 'power_type': power_data.get('power_type', 'manual'),
}
+ if 'power_address' in power_data:
+ data['power_parameters_power_address'] = power_data['power_address']
if 'power_driver' in power_data:
data['power_parameters_power_driver'] = power_data['power_driver']
if 'power_user' in power_data: