Favors dash instead of underscore in autoinstall

Most autoinstall things are using dash instead of underscore.
This commit is contained in:
Carlos Nihelton 2023-03-03 15:09:07 -03:00
parent 2cede5aadd
commit 28f6c29ca1
No known key found for this signature in database
GPG Key ID: 6FE346D245197E9A
3 changed files with 15 additions and 14 deletions

View File

@ -461,13 +461,13 @@
"additionalProperties": false "additionalProperties": false
} }
}, },
"active_directory": { "active-directory": {
"type": "object", "type": "object",
"properties": { "properties": {
"admin_name": { "admin-name": {
"type": "string" "type": "string"
}, },
"domain_name": { "domain-name": {
"type": "string" "type": "string"
} }
}, },

View File

@ -406,7 +406,7 @@ The hostname for the system.
The password for the new user, crypted. This is required for use with sudo, even if SSH access is configured. The password for the new user, crypted. This is required for use with sudo, even if SSH access is configured.
### active_directory ### active-directory
**type:** mapping, see below **type:** mapping, see below
**default:** no default **default:** no default
@ -416,11 +416,11 @@ Accepts data required to join the target system in an Active Directory domain.
A mapping that can contain keys, all of which take string values: A mapping that can contain keys, all of which take string values:
#### admin_name #### admin-name
A domain account name with privilege to perform the join operation. That account's password will be requested during runtime. A domain account name with privilege to perform the join operation. That account's password will be requested during runtime.
#### domain_name #### domain-name
The Active Directory domain to join. The Active Directory domain to join.

View File

@ -93,34 +93,35 @@ class AdController(SubiquityController):
""" Implements the server part of the Active Directory feature. """ """ Implements the server part of the Active Directory feature. """
endpoint = API.active_directory endpoint = API.active_directory
# No auto install key and schema for now due password handling uncertainty. # No auto install key and schema for now due password handling uncertainty.
autoinstall_key = model_name = "active_directory" autoinstall_key = "active-directory"
model_name = "active_directory"
autoinstall_schema = { autoinstall_schema = {
'type': 'object', 'type': 'object',
'properties': { 'properties': {
'admin_name': { 'admin-name': {
'type': 'string', 'type': 'string',
}, },
'domain_name': { 'domain-name': {
'type': 'string', 'type': 'string',
}, },
}, },
'additionalProperties': False, 'additionalProperties': False,
} }
autoinstall_default = {"admin_name": '', 'domain_name': ''} autoinstall_default = {"admin-name": '', 'domain-name': ''}
def make_autoinstall(self): def make_autoinstall(self):
info = self.model.conn_info info = self.model.conn_info
if info is None: if info is None:
return None return None
return {'admin_name': info.admin_name, 'domain_name': info.domain_name} return {'admin-name': info.admin_name, 'domain-name': info.domain_name}
def load_autoinstall_data(self, data): def load_autoinstall_data(self, data):
if data is None: if data is None:
return return
if 'admin_name' in data and 'domain_name' in data: if 'admin-name' in data and 'domain-name' in data:
info = AdConnectionInfo(admin_name=data['admin_name'], info = AdConnectionInfo(admin_name=data['admin-name'],
domain_name=data['domain_name']) domain_name=data['domain-name'])
self.model.set(info) self.model.set(info)
self.model.do_join = False self.model.do_join = False