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
}
},
"active_directory": {
"active-directory": {
"type": "object",
"properties": {
"admin_name": {
"admin-name": {
"type": "string"
},
"domain_name": {
"domain-name": {
"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.
### active_directory
### active-directory
**type:** mapping, see below
**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:
#### admin_name
#### admin-name
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.

View File

@ -93,34 +93,35 @@ class AdController(SubiquityController):
""" Implements the server part of the Active Directory feature. """
endpoint = API.active_directory
# 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 = {
'type': 'object',
'properties': {
'admin_name': {
'admin-name': {
'type': 'string',
},
'domain_name': {
'domain-name': {
'type': 'string',
},
},
'additionalProperties': False,
}
autoinstall_default = {"admin_name": '', 'domain_name': ''}
autoinstall_default = {"admin-name": '', 'domain-name': ''}
def make_autoinstall(self):
info = self.model.conn_info
if info is 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):
if data is None:
return
if 'admin_name' in data and 'domain_name' in data:
info = AdConnectionInfo(admin_name=data['admin_name'],
domain_name=data['domain_name'])
if 'admin-name' in data and 'domain-name' in data:
info = AdConnectionInfo(admin_name=data['admin-name'],
domain_name=data['domain-name'])
self.model.set(info)
self.model.do_join = False