diff options
| author | Luis Fernandez Alvarez <luis.fernandez.alvarez@cern.ch> | 2012-09-25 17:33:59 +0200 |
|---|---|---|
| committer | Luis Fernandez Alvarez <luis.fernandez.alvarez@cern.ch> | 2012-09-26 13:43:16 +0200 |
| commit | 5dd1553cca7f7e62eebce75e1d936fc211b239ec (patch) | |
| tree | 0baa1235bf1c86d9f3a3f821f53db92e5012f5dd /nova/volume | |
| parent | c367fa5e4a5e4712bde9fc319ae6c2f4f2add606 (diff) | |
Replaced default hostname function from gethostname to getfqdn
Fixes bug 1055503
The standard behaviour of the 'gethostname' function in Python differs from
Linux to Windows. A common Linux configuration returns the FQDN, while a
Windows one returns only the host name.
To resolve inconsistent node naming in deployments that mix windows and
Linux, it is proposed to use 'getfqdn' as default function instead of
'gethostname'. This is function is more predictable in all cases.
Change-Id: I3164d9a36df2b8484bbf9a57879c31fa0e342503
Diffstat (limited to 'nova/volume')
| -rw-r--r-- | nova/volume/solidfire.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/nova/volume/solidfire.py b/nova/volume/solidfire.py index 14c9eea1c..8c4ca6684 100644 --- a/nova/volume/solidfire.py +++ b/nova/volume/solidfire.py @@ -167,7 +167,7 @@ class SolidFire(SanISCSIDriver): just return it. If not, then create it. """ - sf_account_name = socket.gethostname() + '-' + nova_project_id + sf_account_name = socket.getfqdn() + '-' + nova_project_id sfaccount = self._get_sfaccount_by_name(sf_account_name) if sfaccount is None: LOG.debug(_('solidfire account: %s does not exist, create it...'), @@ -194,7 +194,7 @@ class SolidFire(SanISCSIDriver): def _do_export(self, volume): """Gets the associated account, retrieves CHAP info and updates.""" - sfaccount_name = '%s-%s' % (socket.gethostname(), volume['project_id']) + sfaccount_name = '%s-%s' % (socket.getfqdn(), volume['project_id']) sfaccount = self._get_sfaccount_by_name(sfaccount_name) model_update = {} @@ -304,7 +304,7 @@ class SolidFire(SanISCSIDriver): """ LOG.debug(_("Enter SolidFire delete_volume...")) - sf_account_name = socket.gethostname() + '-' + volume['project_id'] + sf_account_name = socket.getfqdn() + '-' + volume['project_id'] sfaccount = self._get_sfaccount_by_name(sf_account_name) if sfaccount is None: raise exception.SfAccountNotFound(account_name=sf_account_name) @@ -352,7 +352,7 @@ class SolidFire(SanISCSIDriver): def _do_create_snapshot(self, snapshot, snapshot_name): """Creates a snapshot.""" LOG.debug(_("Enter SolidFire create_snapshot...")) - sf_account_name = socket.gethostname() + '-' + snapshot['project_id'] + sf_account_name = socket.getfqdn() + '-' + snapshot['project_id'] sfaccount = self._get_sfaccount_by_name(sf_account_name) if sfaccount is None: raise exception.SfAccountNotFound(account_name=sf_account_name) |
