From 28f6c29ca15dd08fbc97cab6c629bf79384c71ce Mon Sep 17 00:00:00 2001 From: Carlos Nihelton Date: Fri, 3 Mar 2023 15:09:07 -0300 Subject: [PATCH] Favors dash instead of underscore in autoinstall Most autoinstall things are using dash instead of underscore. --- autoinstall-schema.json | 6 +++--- documentation/autoinstall-reference.md | 6 +++--- subiquity/server/controllers/ad.py | 17 +++++++++-------- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/autoinstall-schema.json b/autoinstall-schema.json index e2a877ef..708239d0 100644 --- a/autoinstall-schema.json +++ b/autoinstall-schema.json @@ -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" } }, diff --git a/documentation/autoinstall-reference.md b/documentation/autoinstall-reference.md index 3fcd05d1..996720b9 100644 --- a/documentation/autoinstall-reference.md +++ b/documentation/autoinstall-reference.md @@ -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. diff --git a/subiquity/server/controllers/ad.py b/subiquity/server/controllers/ad.py index 185aab61..a5b23614 100644 --- a/subiquity/server/controllers/ad.py +++ b/subiquity/server/controllers/ad.py @@ -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