Skip to content

Commit

Permalink
Handle the case where FQDN is the same as hostname
Browse files Browse the repository at this point in the history
The upgrade from config version 9 to 10 might result in the
removal of all gateways if the gateway FQDNs are the same as
the hostnames.

Signed-off-by: Jason Dillaman <[email protected]>
  • Loading branch information
Jason Dillaman committed Jun 29, 2019
1 parent b2a236f commit 826f788
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ceph_iscsi_config/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,15 +328,15 @@ def _upgrade_config(self):
gateways_config = self.config['gateways']
gateway_config = gateways_config.get(this_shortname)
if gateway_config:
gateways_config[this_fqdn] = gateway_config
gateways_config.pop(this_shortname)
gateways_config[this_fqdn] = gateway_config
self.update_item("gateways", None, gateways_config)
for target_iqn, target in self.config['targets'].items():
portals_config = target['portals']
portal_config = portals_config.get(this_shortname)
if portal_config:
portals_config[this_fqdn] = portal_config
portals_config.pop(this_shortname)
portals_config[this_fqdn] = portal_config
self.update_item("targets", target_iqn, target)
for disk_id, disk in self.config['disks'].items():
if disk.get('allocating_host') == this_shortname:
Expand Down

0 comments on commit 826f788

Please sign in to comment.