From patchwork Fri Sep 29 13:47:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Pirko X-Patchwork-Id: 13404273 X-Patchwork-Delegate: kuba@kernel.org Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A6C64179B6 for ; Fri, 29 Sep 2023 13:47:49 +0000 (UTC) Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com [IPv6:2a00:1450:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B7D8F1A8 for ; Fri, 29 Sep 2023 06:47:47 -0700 (PDT) Received: by mail-ej1-x632.google.com with SMTP id a640c23a62f3a-9b281a2aa94so1290009766b.2 for ; Fri, 29 Sep 2023 06:47:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=resnulli-us.20230601.gappssmtp.com; s=20230601; t=1695995266; x=1696600066; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=fJGMiysx/JfRAL6iX46WM7AExnXBLd3c6bT4aLtreL4=; b=kaAr/QaFu7d9i468dQPsMTfM16AJk4E1hKykmDUDrwrwLib/yBja2RKjlXfJdOTovT Us5WX6uM+nkeAfRntvIC3sThZ0N8N8AaD0jUe0z2a/5lj1uOGxfykIUksqVYGaJCl6v4 AOPnj3vyDTtkHemvK4cyFf7NnJ9zCCIbOFxFq+mLH0sCGog0GiyjofAqpdCK0FZ7iXNi LVwODcKyN19sLoY1dirJ0iEyVdpdQ40EZrzfePlT2J4njGlsCE0DKffiOXdssBEUbs0J 3qfb3FhLQYJYwKhO6t47wFG216LZmfJXbJ6Qf5i3LgzgW62C8dWKfFm/A/zJogLU3aUo ZQeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695995266; x=1696600066; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fJGMiysx/JfRAL6iX46WM7AExnXBLd3c6bT4aLtreL4=; b=GgIC0wCuqUud43Pl2QJN6MgGeF9XyD9QkeAX8cJq1jdHk/vn0Dbwqct5EerqLTxZhy pG2x+0Y/YIbWXjJ66q4W9bhtWlDaQP438UgLR9CuxAsulBEgxdhf5+xF9FkReDJbRJgV Lf6o5o2g65MELlFQaC1i+21vfoVjeTMad80OS1AiA+J0ouAG6jsnk+0Bth1naimjBUbO M/Xi56mzeDL/UTLMEuEgkX0WZdiICkmxySFCC0l2u/CO8hS36g3neKEp2O2ct01hFGc2 Dc4M8NQe/g+o9vdicwNREEHVHY08256aMa99GLay3a4Q6DYUfLeLcoMY1og74JZx92+F BzDw== X-Gm-Message-State: AOJu0YzZlpiGBdoYX6kmucAGUr4UcBk6DdrB8PSArwuqY9x+hbc3m0fv 0sZBnzyZ8JuTlOxEX6CDyKClJPag2dpZchASmmE= X-Google-Smtp-Source: AGHT+IGxreHUNbAVxmJA0qiF3WufuAnfyhKvy1jR0RlP30FXWDIIScORftZBR9TyBIyJVCHixYudKw== X-Received: by 2002:a17:906:32cb:b0:9a2:232f:6f85 with SMTP id k11-20020a17090632cb00b009a2232f6f85mr3966998ejk.52.1695995266066; Fri, 29 Sep 2023 06:47:46 -0700 (PDT) Received: from localhost (host-213-179-129-39.customer.m-online.net. [213.179.129.39]) by smtp.gmail.com with ESMTPSA id fi3-20020a170906da0300b009a1fef32ce6sm12572151ejb.177.2023.09.29.06.47.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Sep 2023 06:47:45 -0700 (PDT) From: Jiri Pirko To: netdev@vger.kernel.org Cc: kuba@kernel.org, pabeni@redhat.com, davem@davemloft.net, edumazet@google.com, donald.hunter@gmail.com Subject: [patch net-next v2 1/3] tools: ynl-gen: lift type requirement for attribute subsets Date: Fri, 29 Sep 2023 15:47:40 +0200 Message-ID: <20230929134742.1292632-2-jiri@resnulli.us> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230929134742.1292632-1-jiri@resnulli.us> References: <20230929134742.1292632-1-jiri@resnulli.us> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE, T_FILL_THIS_FORM_SHORT autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Patchwork-Delegate: kuba@kernel.org From: Jiri Pirko In case an attribute is used in a subset, the type has to be currently specified. As the attribute is already defined in the original set, this is a redundant information in yaml file, moreover, may lead to inconsistencies. Example: attribute-sets: ... name: pin enum-name: dpll_a_pin attributes: ... - name: parent-id type: u32 ... - name: pin-parent-device subset-of: pin attributes: - name: parent-id type: u32 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Remove the requirement from schema files to specify the "type" and add check and bail out if "type" is not set. Signed-off-by: Jiri Pirko --- Documentation/netlink/genetlink-c.yaml | 2 +- Documentation/netlink/genetlink-legacy.yaml | 2 +- Documentation/netlink/genetlink.yaml | 2 +- Documentation/netlink/netlink-raw.yaml | 2 +- tools/net/ynl/ynl-gen-c.py | 2 ++ 5 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Documentation/netlink/genetlink-c.yaml b/Documentation/netlink/genetlink-c.yaml index 9806c44f604c..80d8aa2708c5 100644 --- a/Documentation/netlink/genetlink-c.yaml +++ b/Documentation/netlink/genetlink-c.yaml @@ -142,7 +142,7 @@ properties: type: array items: type: object - required: [ name, type ] + required: [ name ] additionalProperties: False properties: name: diff --git a/Documentation/netlink/genetlink-legacy.yaml b/Documentation/netlink/genetlink-legacy.yaml index 12a0a045605d..2a21aae525a4 100644 --- a/Documentation/netlink/genetlink-legacy.yaml +++ b/Documentation/netlink/genetlink-legacy.yaml @@ -180,7 +180,7 @@ properties: type: array items: type: object - required: [ name, type ] + required: [ name ] additionalProperties: False properties: name: diff --git a/Documentation/netlink/genetlink.yaml b/Documentation/netlink/genetlink.yaml index 3d338c48bf21..9e8354f80466 100644 --- a/Documentation/netlink/genetlink.yaml +++ b/Documentation/netlink/genetlink.yaml @@ -115,7 +115,7 @@ properties: type: array items: type: object - required: [ name, type ] + required: [ name ] additionalProperties: False properties: name: diff --git a/Documentation/netlink/netlink-raw.yaml b/Documentation/netlink/netlink-raw.yaml index 896797876414..9aeb64b27ada 100644 --- a/Documentation/netlink/netlink-raw.yaml +++ b/Documentation/netlink/netlink-raw.yaml @@ -187,7 +187,7 @@ properties: type: array items: type: object - required: [ name, type ] + required: [ name ] additionalProperties: False properties: name: diff --git a/tools/net/ynl/ynl-gen-c.py b/tools/net/ynl/ynl-gen-c.py index 897af958cee8..b378412a9d7a 100755 --- a/tools/net/ynl/ynl-gen-c.py +++ b/tools/net/ynl/ynl-gen-c.py @@ -723,6 +723,8 @@ class AttrSet(SpecAttrSet): self.c_name = '' def new_attr(self, elem, value): + if 'type' not in elem: + raise Exception(f"Type has to be set for attribute {elem['name']}") if elem['type'] in scalars: t = TypeScalar(self.family, self, elem, value) elif elem['type'] == 'unused': From patchwork Fri Sep 29 13:47:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Pirko X-Patchwork-Id: 13404274 X-Patchwork-Delegate: kuba@kernel.org Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 88C31BE4F for ; Fri, 29 Sep 2023 13:47:51 +0000 (UTC) Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 815BA1AB for ; Fri, 29 Sep 2023 06:47:49 -0700 (PDT) Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-99bdeae1d0aso1909166966b.1 for ; Fri, 29 Sep 2023 06:47:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=resnulli-us.20230601.gappssmtp.com; s=20230601; t=1695995268; x=1696600068; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=i8QojxeRYsrfEub+ueQzXhzL/3NhmUL7iaIG8nx5dBA=; b=sMO36QjJZaBwAn1nPLwloGHG4panPBpKQ9nxTs5x1xFm1Sh6Jj4jsxHieeoG2Ueu6b tWCPhCCqJgNyeohwKHzb/61gtN3xGI5A7qB1WQRtlNaGw95eQG/G01+0VmFucgjADoqz 6WYr4iIjVWYBmilAvJCaFRE6kgSYFUOgIU+bNGOO8h04vGkGNqVxaQXoBCPkzkuWWf8b 7+uLf1mUimIGAauYAgtz3yoCl6mt5BMAwyPgwDawRLEXZaF+TwrA86xl2rgC4S33I/Wn aJTbo1nmkbAP5sZIeWhiEP8Wsq4zz9n0GFJwiJym6X2BWF4EtKi1mXaBAdTBMANLzNrD AS5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695995268; x=1696600068; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=i8QojxeRYsrfEub+ueQzXhzL/3NhmUL7iaIG8nx5dBA=; b=jmaxoA9CnoZe78UnLBKgTHTdxeDSW5Vp7CsWcPbNL/S/+IKp8BsDdaeEnGdtd9D4Oz tZ5ru/FHQyX0joEfgr+389xXdsF+6nWFu7vJlTVWhwR8VtAB2vda8YaRGnQmlum8YMs5 MfffHDqIXZAK8nt1XsiknljtG2smJRe4og/oS42fkxLQT6XRFCVjMSUxWIqeXxvUxo9V IzgBmL4JncutmKL7MYNda3huj9156snyECnh0DlF/JVUFCXXoRUcmHIh5yLungBY18nS CLfDm2J7D9OgFyK2G0cM7nCs70mTE9U+nSOu+3NvvNOVZwQ1C89poY0cwYhiuauvZspR Qf6w== X-Gm-Message-State: AOJu0YyJIxcYZj+SZ7q2BQaMrhxG9F1nQo0VLBFG+TNz+Y4CTshV9L9j BEtwWTPPpx+Pe/RdrJrzb2arVvoU2oNrC9nsdzY= X-Google-Smtp-Source: AGHT+IF/cjsxL6GZ5W70cVs2wnxZ2EiRai+4BVInWaTZ1IYQMgh/MyiCsCk+f7z16d6ueR+jf8VWyw== X-Received: by 2002:a17:906:2212:b0:9a5:9f8d:770 with SMTP id s18-20020a170906221200b009a59f8d0770mr3981110ejs.46.1695995267820; Fri, 29 Sep 2023 06:47:47 -0700 (PDT) Received: from localhost (host-213-179-129-39.customer.m-online.net. [213.179.129.39]) by smtp.gmail.com with ESMTPSA id j25-20020a170906255900b0099bcf1c07c6sm12365594ejb.138.2023.09.29.06.47.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Sep 2023 06:47:47 -0700 (PDT) From: Jiri Pirko To: netdev@vger.kernel.org Cc: kuba@kernel.org, pabeni@redhat.com, davem@davemloft.net, edumazet@google.com, donald.hunter@gmail.com Subject: [patch net-next v2 2/3] netlink: specs: remove redundant type keys from attributes in subsets Date: Fri, 29 Sep 2023 15:47:41 +0200 Message-ID: <20230929134742.1292632-3-jiri@resnulli.us> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230929134742.1292632-1-jiri@resnulli.us> References: <20230929134742.1292632-1-jiri@resnulli.us> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Patchwork-Delegate: kuba@kernel.org From: Jiri Pirko No longer needed to define type for subset attributes. Remove those. Signed-off-by: Jiri Pirko Reviewed-by: Jakub Kicinski --- v1->v2: - new patch --- Documentation/netlink/specs/devlink.yaml | 10 ---------- Documentation/netlink/specs/dpll.yaml | 8 -------- Documentation/netlink/specs/ethtool.yaml | 3 --- 3 files changed, 21 deletions(-) diff --git a/Documentation/netlink/specs/devlink.yaml b/Documentation/netlink/specs/devlink.yaml index d1ebcd927149..86a12c5bcff1 100644 --- a/Documentation/netlink/specs/devlink.yaml +++ b/Documentation/netlink/specs/devlink.yaml @@ -199,54 +199,44 @@ attribute-sets: attributes: - name: reload-stats - type: nest - name: remote-reload-stats - type: nest - name: dl-reload-stats subset-of: devlink attributes: - name: reload-action-info - type: nest - name: dl-reload-act-info subset-of: devlink attributes: - name: reload-action - type: u8 - name: reload-action-stats - type: nest - name: dl-reload-act-stats subset-of: devlink attributes: - name: reload-stats-entry - type: nest - name: dl-reload-stats-entry subset-of: devlink attributes: - name: reload-stats-limit - type: u8 - name: reload-stats-value - type: u32 - name: dl-info-version subset-of: devlink attributes: - name: info-version-name - type: string - name: info-version-value - type: string operations: enum-model: directional diff --git a/Documentation/netlink/specs/dpll.yaml b/Documentation/netlink/specs/dpll.yaml index 8b86b28b47a6..1c1b53136c7b 100644 --- a/Documentation/netlink/specs/dpll.yaml +++ b/Documentation/netlink/specs/dpll.yaml @@ -278,36 +278,28 @@ attribute-sets: attributes: - name: parent-id - type: u32 - name: direction - type: u32 - name: prio - type: u32 - name: state - type: u32 - name: pin-parent-pin subset-of: pin attributes: - name: parent-id - type: u32 - name: state - type: u32 - name: frequency-range subset-of: pin attributes: - name: frequency-min - type: u64 - name: frequency-max - type: u64 operations: enum-name: dpll_cmd diff --git a/Documentation/netlink/specs/ethtool.yaml b/Documentation/netlink/specs/ethtool.yaml index 837b565577ca..5c7a65b009b4 100644 --- a/Documentation/netlink/specs/ethtool.yaml +++ b/Documentation/netlink/specs/ethtool.yaml @@ -818,13 +818,10 @@ attribute-sets: attributes: - name: hist-bkt-low - type: u32 - name: hist-bkt-hi - type: u32 - name: hist-val - type: u64 - name: stats attributes: From patchwork Fri Sep 29 13:47:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Pirko X-Patchwork-Id: 13404275 X-Patchwork-Delegate: kuba@kernel.org Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4FB0FBE4F for ; Fri, 29 Sep 2023 13:47:54 +0000 (UTC) Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [IPv6:2a00:1450:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D83E9DB for ; Fri, 29 Sep 2023 06:47:50 -0700 (PDT) Received: by mail-ed1-x535.google.com with SMTP id 4fb4d7f45d1cf-530fa34ab80so1535971a12.0 for ; Fri, 29 Sep 2023 06:47:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=resnulli-us.20230601.gappssmtp.com; s=20230601; t=1695995269; x=1696600069; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=2EIf4la/I8Qsb0HKDrhvyHC0R4I00Z7if5k71vTFXOk=; b=jBFZ6u3RPHx21928CyitrWWonx5bhMbVLdlF9ExNuXfqGde9PbfSWKj0mJdlhKzqSp nwFe+NXTa6id5YeM6uIJlLQAaE/kWPUCciyTLdRhXhK+Q/+b72Wy0a45/pL9Y8Ons0Um WrNXIEyZWR8U5zhgitACsz+9omIGliKpHZsptN0zDOxITNQbviXJuTCiVkuf6Dx9BTYA S+6ggoZLtdCvCsonsYfZNjmD+8TwVbUkSUgVWz87OYPTlzkNEB4qi5kRpQG6CjkzAcNt EISB36/y7KGzXAoz9Z+Eo8BztLOap7NhII6xjHHy+DEl8wYMUEw/VoEqbwqzACGkHrQ7 XVhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695995269; x=1696600069; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2EIf4la/I8Qsb0HKDrhvyHC0R4I00Z7if5k71vTFXOk=; b=cgl+4z58EDG3aU1zduzgwTwgZY+g/uyp1CHkx8P3gexf+TxNbpyc4e7E4KDmvyQQRu sy2Io4UN/yzyMKaRTn0uC2PNxDSo8lg9Kpz0Sl7eRS6KXwwpbWSU4mTh/4yI/YlW1FqO 0kYjl96gVNN0IZKGuybTJKaeYVZXUAeoQmk1E18XWGbg98KE3IwQirmiJEqib8o/nMJ3 BBhC4EnBJikio8l8kB84fNvG7xVLdG/FAQTAFDPsHCGsmf+xbJVU5IZdixICl2kZB7MA 8pwOeOe916Z3iUCNuEH2ljXlZhv9s2f9HgcYGwJYyg1FZCLH9mx5PCAa3FBGa4IWSpl4 ELuw== X-Gm-Message-State: AOJu0YzPyWPRpP3D9LObRyl/dxfQ8Gu8Rcqe/n5uvBfc2WYB0tSOmDAl JzJS7Vu9ge93SSDl7+1mWgEJoTt2UPLOkFT6TrE= X-Google-Smtp-Source: AGHT+IHscpHyUMU/oVJFsXY/5WErByqNKo4OyNE4Za6MmVDk173Ykg0k9+cWZwyyn6iQ7MHjfZ7z+g== X-Received: by 2002:a17:907:75c4:b0:9ae:6196:5094 with SMTP id jl4-20020a17090775c400b009ae61965094mr4051569ejc.30.1695995269370; Fri, 29 Sep 2023 06:47:49 -0700 (PDT) Received: from localhost (host-213-179-129-39.customer.m-online.net. [213.179.129.39]) by smtp.gmail.com with ESMTPSA id rv2-20020a17090710c200b0099315454e76sm12447535ejb.211.2023.09.29.06.47.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Sep 2023 06:47:48 -0700 (PDT) From: Jiri Pirko To: netdev@vger.kernel.org Cc: kuba@kernel.org, pabeni@redhat.com, davem@davemloft.net, edumazet@google.com, donald.hunter@gmail.com Subject: [patch net-next v2 3/3] tools: ynl-gen: raise exception when subset attribute contains more than "name" key Date: Fri, 29 Sep 2023 15:47:42 +0200 Message-ID: <20230929134742.1292632-4-jiri@resnulli.us> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230929134742.1292632-1-jiri@resnulli.us> References: <20230929134742.1292632-1-jiri@resnulli.us> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Patchwork-Delegate: kuba@kernel.org From: Jiri Pirko The only key used in the elem dictionary is "name" to lookup the real attribute of a set. Raise exception in case there are other keys present. Signed-off-by: Jiri Pirko --- v1->v2: - new patch --- tools/net/ynl/lib/nlspec.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/net/ynl/lib/nlspec.py b/tools/net/ynl/lib/nlspec.py index 37bcb4d8b37b..12e15ac70309 100644 --- a/tools/net/ynl/lib/nlspec.py +++ b/tools/net/ynl/lib/nlspec.py @@ -208,6 +208,8 @@ class SpecAttrSet(SpecElement): attr = real_set[elem['name']] self.attrs[attr.name] = attr self.attrs_by_val[attr.value] = attr + if (len(elem.keys()) > 1): + raise Exception(f"Subset attribute '{elem['name']}' contains other keys") def new_attr(self, elem, value): return SpecAttr(self.family, self, elem, value)