+ tmp_nics = []
+ for field in ('ip', 'mac', 'mode', 'link', 'bridge'):
+ if field in specs:
+ if not tmp_nics:
+ tmp_nics.append({})
+ tmp_nics[0][field] = specs[field]
+
+ if specs['nics'] is not None and tmp_nics:
+ raise errors.OpPrereqError("'nics' list incompatible with using"
+ " individual nic fields as well")
+ elif specs['nics'] is not None:
+ tmp_nics = specs['nics']
+ elif not tmp_nics:
+ tmp_nics = [{}]
+