NetApp ONTAP: change cifs server valid dns hostname

by using hyphen instead of dots and underscore

Change-Id: Iba8131fff3d92100d554a07f42f23c7a38c2e469
Closes-Bug: #1716694
This commit is contained in:
Maurice Schreiber 2017-09-29 10:35:50 +02:00
parent a17c89ff08
commit a8ea49c547
No known key found for this signature in database
GPG Key ID: D39C8CD40259CE1F
4 changed files with 13 additions and 5 deletions

View File

@ -53,4 +53,4 @@
* - ``netapp_volume_snapshot_reserve_percent`` = ``5``
- (Integer) The percentage of share space set aside as reserve for snapshot usage; valid values range from 0 to 90.
* - ``netapp_vserver_name_template`` = ``os_%s``
- (String) Name template to use for new Vserver.
- (String) Name template to use for new Vserver. When using CIFS protocol make sure to not configure characters illegal in DNS hostnames.

View File

@ -1381,7 +1381,11 @@ class NetAppCmodeClient(client_base.NetAppBaseClient):
# 'cifs-server' is CIFS Server NetBIOS Name, max length is 15.
# Should be unique within each domain (data['domain']).
cifs_server = (vserver_name[0:7] + '..' + vserver_name[-6:]).upper()
# Cut to 15 char with begin and end, attempt to make valid DNS hostname
cifs_server = (vserver_name[0:8] +
'-' +
vserver_name[-6:]).replace('_', '-').upper()
api_args = {
'admin-username': security_service['user'],
'admin-password': security_service['password'],

View File

@ -71,7 +71,9 @@ netapp_provisioning_opts = [
default='share_%(share_id)s'),
cfg.StrOpt('netapp_vserver_name_template',
default='os_%s',
help='Name template to use for new Vserver.'),
help='Name template to use for new Vserver. '
'When using CIFS protocol make sure to not '
'configure characters illegal in DNS hostnames.'),
cfg.StrOpt('netapp_qos_policy_group_name_template',
help='NetApp QoS policy group name template.',
default='qos_share_%(share_id)s'),

View File

@ -2434,8 +2434,10 @@ class NetAppClientCmodeTestCase(test.TestCase):
self.client.configure_active_directory(fake.CIFS_SECURITY_SERVICE,
fake.VSERVER_NAME)
cifs_server = (
fake.VSERVER_NAME[0:7] + '..' + fake.VSERVER_NAME[-6:]).upper()
cifs_server = (fake.VSERVER_NAME[0:8] +
'-' +
fake.VSERVER_NAME[-6:]).replace('_', '-').upper()
cifs_server_create_args = {
'admin-username': fake.CIFS_SECURITY_SERVICE['user'],
'admin-password': fake.CIFS_SECURITY_SERVICE['password'],