LOG.error(err)
raise exception.InvalidInput(reason=err)
- domain = cpg['domain']
- if not domain:
- err = (_("CPG (%s) must be in a domain") % cpg_name)
- LOG.error(err)
- raise exception.InvalidInput(reason=err)
- return domain
+ if 'domain' in cpg:
+ return cpg['domain']
+ return None
def extend_volume(self, volume, new_size):
volume_name = self._get_3par_vol_name(volume['id'])
the same wwn but with a different hostname, return the hostname
used by 3PAR.
"""
- command = ['createhost', '-persona', persona_id, '-domain', domain,
- hostname]
+ if domain is not None:
+ command = ['createhost', '-persona', persona_id, '-domain', domain,
+ hostname]
+ else:
+ command = ['createhost', '-persona', persona_id, hostname]
for wwn in wwns:
command.append(wwn)
the same iqn but with a different hostname, return the hostname
used by 3PAR.
"""
- cmd = ['createhost', '-iscsi', '-persona', persona_id, '-domain',
- domain, hostname, iscsi_iqn]
+ if domain is not None:
+ cmd = ['createhost', '-iscsi', '-persona', persona_id, '-domain',
+ domain, hostname, iscsi_iqn]
+ else:
+ cmd = ['createhost', '-iscsi', '-persona', persona_id, hostname,
+ iscsi_iqn]
out = self.common._cli_run(cmd)
if out and len(out) > 1:
return self.common.parse_create_host_error(hostname, out)