Merge "NetApp ONTAP: change cifs server valid dns hostname"

This commit is contained in:
Zuul 2018-08-25 04:06:21 +00:00 committed by Gerrit Code Review
commit 1fc1a1001d
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'],